code: def slice(self, start, stop=None, axis=0):
          
          if stop is None:
              # Make a 1=bin slice
              stop = start
          axis = self.get_axis_number(axis)
          start_bin = max(0, self.get_axis_bin_index(start, axis))
          stop_bin = min(len(self.bin_centers(axis)) - 1,  # TODO: test off by one!
                         self.get_axis_bin_index(stop, axis))
          new_bin_edges = self.bin_edges.copy()
          new_bin_edges[axis] = new_bin_edges[axis][start_bin:stop_bin + 2]   # TODO: Test off by one here!
          return Histdd.from_histogram(np.take(self.histogram, np.arange(start_bin, stop_bin + 1), axis=axis),
                                       bin_edges=new_bin_edges, axis_names=self.axis_names)
docs: Restrict histogram to bins whose data values (not bin numbers) along axis are between start and stop
          (both inclusive). Returns d dimensional histogram.