def rank ( self ) : r = np . empty ( self . size , np . int ) r [ self . sorter ] = np . arange ( self . size ) return r
python numpy top k indeces
how high in sorted list each key is . inverse permutation of sorter such that sorted [ rank ] == keys
def rank(self):
        """how high in sorted list each key is. inverse permutation of sorter, such that sorted[rank]==keys"""
        r = np.empty(self.size, np.int)
        r[self.sorter] = np.arange(self.size)
        return r