To count the occurences of a value in a numpy array. This will work:
>>> import numpy as np
>>> a=np.array([0,3,4,3,5,4,7])
>>> print np.sum(a==3)
2
The logic is that the boolean statement produces a array where all occurences of the requested values are 1 and all o...