def get_slices(self, level=0):
        # TODO: refactor this
        groups = self.index.get_level_values(level).unique()
        groups.sort()
        if isinstance(self.index, MultiIndex):
            self.slices = [self.index.get_loc_level(x, level=level)[0]
                           for x in groups]
        else:
            self.slices = [self.index.get_loc(x) for x in groups]
Sets the slices attribute to be a list of indices of the sorted
dataset/ETHPy150Open statsmodels/statsmodels/statsmodels/tools/grouputils.py/Grouping.get_slices