def _fast_count_smallints(arr):
counts = np.bincount(arr.astype(np.int_))<EOL>nz = counts.nonzero()[<NUM_LIT:0>]<EOL>return np.c_[nz, counts[nz]]<EOL>
Faster version of set(arr) for sequences of small numbers.