def median1d(slc):
    slc = slc[self.index.sorter]
    sorter = np.lexsort((slc, sorted_group_rank_per_key))
    slc = slc[sorter]
    return (((slc[lo] + slc[hi]) / 2) if average else slc[hi])
def median1d(slc):
    slc = slc[self.index.sorter]
    sorter = np.lexsort((slc, sorted_group_rank_per_key))
    slc = slc[sorter]
    return (((slc[lo] + slc[hi]) / 2) if average else slc[hi])