I have to count all the values in a matrix (2-d array) that are greater than 200.
The code I wrote down for this is:
za=0 p31 = numpy.asarray(o31)
Here's a variant that uses fancy indexing and has the actual values as an intermediate:
p31 = numpy.asarray(o31) values = p31[p31<200] za = len(values)