I have two numpy arrays, let's say A and B
In [3]: import numpy as np
In [4]: A = np.array([0.10,0.20,0.30,0.40,0.50])
In [5]: B = np.array([0.15,0.23,0.33,0.41,0.57])
I apply a condition like this:
In [6]: condition_array = A[(B>0.2)*(B<0.5)]
In [7]: condition_array
Out[7]: array([ 0.2, 0.3, 0.4])
Now how do I get the opposite of condition_array?
i.e. the values of array A for which array B is NOT GREATER THAN 0.2 and NOT LESS THAN 0.5 ?
In [8]: test_array = A[(B<0.2)*(B>0.5)]
In [9]: test_array
Out[9]: array([], dtype=float64)
The above doesn't seem to work !
NOT GREATER THANis the same thing asLESS THAN OR EQUAL TOandNOT LESS THANis the same thing asGREATER THAN OR EQUAL TO< 0.2and>0.5which is what your code is asking for.