class_docstr: Univariate and bivariate histogram estimator.
class_docstr_tok: ["Univariate","and","bivariate","histogram","estimator","."]
docstr: Inner function that takes bin parameters as arguments.
docstr_tok: ["Inner","function","that","takes","bin","parameters","as","arguments","."]
code: def _define_bin_edges(
      self, x, weights, bins, binwidth, binrange, discrete
  ):
      """Inner function that takes bin parameters as arguments."""
      if binrange is None:
          start, stop = x.min(), x.max()
      else:
          start, stop = binrange
  
      if discrete:
          bin_edges = np.arange(start - 0.5, stop + 1.5)
      elif binwidth is not None:
          step = binwidth
          bin_edges = np.arange(start, stop + step, step)
          # Handle roundoff error (maybe there is a less clumsy way?)
          if bin_edges.max() < stop or len(bin_edges) < 2:
              bin_edges = np.append(bin_edges, bin_edges.max() + step)
      else:
          bin_edges = np.histogram_bin_edges(
              x,
              bins,
              binrange,
              weights,
          )
      return bin_edges
  
imports: from numbers import Number
  from statistics import NormalDist
  import numpy
  import pandas
  from .algorithms import bootstrap
  from .utils import _check_argument
label_desc: Use image node_id 2 for calling the Histogram obj's underlying member method code with example usage: obj._define_bin_edges(x, weights, bins, binwidth, binrange, discrete) and returns: bin_edges