def _set_selection_from_grouper(self):
        grp = self.grouper
        if self.as_index and getattr(grp, 'groupings', None) is not None and \
           self.obj.ndim > 1:
            ax = self.obj._info_axis
            groupers = [g.name for g in grp.groupings
                        if g.level is None and g.in_axis]

            if len(groupers):
                self._group_selection = ax.difference(Index(groupers)).tolist()
we may need create a selection if we have non-level groupers
dataset/ETHPy150Open pydata/pandas/pandas/core/groupby.py/_GroupBy._set_selection_from_grouper