code: def rank(keys, axis=semantics.axis_default):
      
      index = as_index(keys, axis)
      return index.rank
docs: where each item is in the pecking order.
  
      Parameters
      ----------
      keys : indexable object
  
      Returns
      -------
      ndarray, [keys.size], int
          unique integers, ranking the sorting order
  
      Notes
      -----
      we should have that index.sorted[index.rank] == keys