Bincount 07 May 2019 import numpy as npa = np.array([1, 2, 4, 5])b = np.bincount(a)b array([0, 1, 1, 0, 1, 1]) b.size 6