I want to replace elements in a np.array, for instance:
arr = np.array([4,5,6,7,3])
I want to replace every element which meets my condition with a given value, for example 3<=x<=5. And replace it with a random number such as randint(90, 99).
Therefore, my expected output is:
[91 94 6 7 92]
I tried something like this:
out = np.where(arr>4, randint(90, 99), arr)
But I have 2 probelms:
1) I can't specity an interval
2) I can't get 3 random numbers - but only one