I tried to change values in an array when it is in some condition.
For example, I would to like to add 30, when the vlaues are only higher than 10.
So, I tried as follows:
x = np.arange(15)
x[x>10] = x + 30
I shows "ValueError: NumPy boolean array indexing assignment cannot assign 15 input values to the 4 output values where the mask is true".
Also I tried if else and np.where methods but they also does not work. They seem work only when replacing quantity is a certain value such as 30, not an equation as x + 30.
Any idea or help would be really appreciated.
Thank you,
Isaac