I have a 2D array of shape say 5000x10, basically like 10 types of values taken 5000 times (thus 5000 profiles), and I want to find see how many of these profiles altogether have a value greater than a number like X. For e.g,
a=np.array([[1,2,3,4,5],[1,2,3,4,6],[-1,2,3,4,-5]])
Here a has a shape of 3x5, so 3 profiles of 6 types. I want to see how many profiles are completely positive (>0) or fully greater than X, so I have used the following code:
d=0
for x in range(3):
if(a[x,:].all()>0):
d=d+1
But d returns 3, which should not be the case, as a[2,:] is not completely positive.
What can I do in this case?
.all(), this is a NumPy array, right?