def find_repeats(arr):
 compr = np.asarray(ma.compressed(arr), dtype=np.float64)
 try:
  need_copy = np.may_share_memory(compr, arr)
 except AttributeError:
  need_copy = False
 if need_copy:
  compr = compr.copy()
 return _find_repeats(compr)

def find_repeats ( arr ) : compr = np . asarray ( ma . compressed ( arr ) , dtype = np . float64 ) try : need_copy = np . may_share_memory ( compr , arr ) except AttributeError : need_copy = False if need_copy : compr = compr . copy ( ) return _find_repeats ( compr )
find repeats and repeat counts .