code: def select(self, axis: AxisIdentifier, index, force_copy: bool = False) -> HistogramBase:
          
          if index == slice(None) and not force_copy:
              return self
  
          axis_id = self._get_axis(axis)
          array_index = [slice(None, None, None) for i in range(self.ndim)]
          array_index[axis_id] = index
  
          frequencies = self._frequencies[tuple(array_index)].copy()
          errors2 = self._errors2[tuple(array_index)].copy()
  
          if isinstance(index, int):
              return self._reduce_dimension([ax for ax in range(self.ndim) if ax != axis_id], frequencies, errors2)
          elif isinstance(index, slice):
              if index.step is not None and index.step < 0:
                  raise IndexError("Cannot change the order of bins")
              copy = self.copy()
              copy._frequencies = frequencies
              copy._errors2 = errors2
              copy._binnings[axis_id] = self._binnings[axis_id][index]
              return copy
          else:
              raise ValueError("Invalid index.")
docs: Select in an axis.
  
          Parameters
          ----------
          axis: int or str
              Axis, in which we select.
          index: int or slice
              Index of bin (as in numpy).
          force_copy: bool
              If True, identity slice force a copy to be made.