docs: def merge_bins(self, amount: Optional[int] = None, *, min_frequency: Optional[float] = None,
                     axis: Optional[AxisIdentifier] = None, inplace: bool = False) -> 'HistogramBase':
          """Reduce the number of bins and add their content:
  
          Parameters
          ----------
          amount: How many adjacent bins to join together.
          min_frequency: Try to have at least this value in each bin
              (this is not enforce e.g. for minima between high bins)
          axis: int or None
              On which axis to do this (None => all)
          inplace: Whether to modify this histogram or return a new one
          """
          if not inplace:
              histogram = self.copy()
              histogram.merge_bins(amount, min_frequency=min_frequency, axis=axis, inplace=True)
              return histogram
          elif axis is None:
              for i in range(self.ndim):
                  self.merge_bins(amount=amount, min_frequency=min_frequency, axis=i, inplace=True)
          else:
              axis = self._get_axis(axis)
              if amount is not None:
                  if not amount == int(amount):
                      raise RuntimeError("Amount must be integer")
                  bin_map = [(i, i // amount) for i in range(self.shape[axis])]
              elif min_frequency is not None:
                  if self.ndim == 1:
                      check = self.frequencies
                  else:
                      check = self.projection(axis).frequencies
                  bin_map = []
                  current_new = 0
                  current_sum = 0
                  for i, freq in enumerate(check):
                      if freq >= min_frequency and current_sum > 0:
                          current_sum = 0
                          current_new += 1
                      bin_map.append((i, current_new))
                      current_sum += freq
                      if current_sum > min_frequency:
                          current_sum = 0
                          current_new += 1
              else:
                  raise NotImplementedError("Not yet implemented.")
              new_binning = self._binnings[axis].apply_bin_map(bin_map)
              self._change_binning(new_binning, bin_map, axis=axis)
              return self