parameters: (arr)
return_statement: return np.c_[nz, counts[nz]]
docstring: Faster version of set(arr) for sequences of small numbers.
docstring_summary: Faster version of set(arr) for sequences of small numbers.
docstring_tokens: Faster version of set ( arr ) for sequences of small numbers .
function: def _fast_count_smallints(arr):
      """Faster version of set(arr) for sequences of small numbers."""
      counts = np.bincount(arr.astype(np.int_))
      nz = counts.nonzero()[0]
      return np.c_[nz, counts[nz]]
function_tokens: def _fast_count_smallints ( arr ) : counts = np . bincount ( arr . astype ( np . int_ ) ) nz = counts . nonzero ( ) [ 0 ] return np . c_ [ nz , counts [ nz ] ]