def count_tied_groups(x, use_missing=False):
 nmasked = ma.getmask(x).sum()
 data = ma.compressed(x).copy()
 (ties, counts) = find_repeats(data)
 nties = {}
 if len(ties):
  nties = dict(zip(np.unique(counts), itertools.repeat(1)))
  nties.update(dict(zip(*find_repeats(counts))))
 if (nmasked and use_missing):
  try:
   nties[nmasked] += 1
  except KeyError:
   nties[nmasked] = 1
 return nties

def count_tied_groups ( x , use_missing = False ) : nmasked = ma . getmask ( x ) . sum ( ) data = ma . compressed ( x ) . copy ( ) ( ties , counts ) = find_repeats ( data ) nties = { } if len ( ties ) : nties = dict ( zip ( np . unique ( counts ) , itertools . repeat ( 1 ) ) ) nties . update ( dict ( zip ( * find_repeats ( counts ) ) ) ) if ( nmasked and use_missing ) : try : nties [ nmasked ] += 1 except KeyError : nties [ nmasked ] = 1 return nties
counts the number of tied values .