Skip to content
masterclass Buddy

NumPy · Function

np.bincount

Counts occurrences of non-negative integer values. Each output index represents an input value; use weights for weighted sums and minlength for a minimum output size.

Last updated

Syntax

numpy.bincount(x, /, weights=None, minlength=0)

In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.

Subscribe
  • histogram
  • digitize
  • unique

Source: numpy.bincount — NumPy v2.5 Manual. Checked 2026-11-03.