code: def _change_binning(self, new_binning, bin_map: Iterable[Tuple[int, int]], axis: int = 0):
          
          axis = int(axis)
          if axis < 0 or axis >= self.ndim:
              raise RuntimeError("Axis must be in range 0..(ndim-1)")
          self._reshape_data(new_binning.bin_count, bin_map, axis)
          self._binnings[axis] = new_binning
docs: Set new binnning and update the bin contents according to a map.
  
          Fills frequencies and errors with 0.
          It's the caller's responsibility to provide correct binning and map.
  
          Parameters
          ----------
          new_binning: physt.binnings.BinningBase
          bin_map: Iterable[tuple]
              tuples contain bin indices (old, new)
          axis: int
              What axis does the binning describe(0..ndim-1)