I assume you already looked at the doc for it? (http://docs.scipy.org/doc/numpy/reference/generated/numpy.bincount.html)