numpy.bincount

numpy.bincount(x, weights=None)

Return the number of occurrences of each value in x.

x must be a list of non-negative integers. The output, b[i], represents the number of times that i is found in x. If weights is specified, every occurrence of i at a position p contributes weights[p] instead of 1.

See also: histogram, digitize, unique.

Previous topic

numpy.histogramdd

Next topic

numpy.digitize

This Page

Quick search