def _rankdata(a, method='average'):
 if (method != 'max'):
  raise NotImplementedError()
 (unique_all, inverse) = np.unique(a, return_inverse=True)
 count = bincount(inverse, minlength=unique_all.size)
 cum_count = count.cumsum()
 rank = cum_count[inverse]
 return rank

def _rankdata ( a , method = 'average' ) : if ( method != 'max' ) : raise NotImplementedError ( ) ( unique_all , inverse ) = np . unique ( a , return_inverse = True ) count = bincount ( inverse , minlength = unique_all . size ) cum_count = count . cumsum ( ) rank = cum_count [ inverse ] return rank
assign ranks to data .