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)
To count the number of values larger than x in any numpy array you can use:
n = len(matrix[matrix > x])
The boolean indexing returns an array that contains only the elements where the condition (matrix > x) is met. Then len() counts these values.