I have a two-dimensional numpy array called meta
with 3 columns.. what I want to do is :
- check if the first two columns are ZERO
- check if the third column is smaller than X
- Return only those rows that match the condition
I made it work, but the solution seem very contrived :
meta[ np.logical_and( np.all( meta[:,0:2] == [0,0],axis=1 ) , meta[:,2] < 20) ]
Could you think of cleaner way ? It seem hard to have multiple conditions at once ;(
thanks
Sorry first time I copied the wrong expression... corrected.