code: def _gotitem(self, key, ndim, subset=None):
          
          self._set_binner()
          grouper = self.grouper
          if subset is None:
              subset = self.obj
          grouped = groupby(subset, by=None, grouper=grouper, axis=self.axis)
  
          # try the key selection
          try:
              return grouped[key]
          except KeyError:
              return grouped
docs: Sub-classes to define. Return a sliced object.
  
          Parameters
          ----------
          key : string / list of selections
          ndim : 1,2
              requested ndim of result
          subset : object, default None
              subset to act on