class_docstr: Univariate and bivariate histogram estimator.
class_docstr_tok: ["Univariate","and","bivariate","histogram","estimator","."]
docstr: Given data, return numpy.histogram parameters to define bins.
docstr_tok: ["Given","data",",","return","numpy.histogram","parameters","to","define","bins","."]
code: def define_bin_params(self, x1, x2=None, weights=None, cache=True):
      """Given data, return numpy.histogram parameters to define bins."""
      if x2 is None:
          bin_edges = self._define_bin_edges(
              x1,
              weights,
              self.bins,
              self.binwidth,
              self.binrange,
              self.discrete,
          )
  
          if isinstance(self.bins, (str, Number)):
              n_bins = len(bin_edges) - 1
              bin_range = bin_edges.min(), bin_edges.max()
              bin_kws = dict(bins=n_bins, range=bin_range)
          else:
              bin_kws = dict(bins=bin_edges)
  
      else:
          bin_edges = []
          for i, x in enumerate([x1, x2]):
              # Resolve out whether bin parameters are shared
              # or specific to each variable
  
              bins = self.bins
              if not bins or isinstance(bins, (str, Number)):
                  pass
              elif isinstance(bins[i], str):
                  bins = bins[i]
              elif len(bins) == 2:
                  bins = bins[i]
  
              binwidth = self.binwidth
              if binwidth is None:
                  pass
              elif not isinstance(binwidth, Number):
                  binwidth = binwidth[i]
  
              binrange = self.binrange
              if binrange is None:
                  pass
              elif not isinstance(binrange[0], Number):
                  binrange = binrange[i]
  
              discrete = self.discrete
              if not isinstance(discrete, bool):
                  discrete = discrete[i]
  
              # Define the bins for this variable
  
              bin_edges.append(
                  self._define_bin_edges(
                      x,
                      weights,
                      bins,
                      binwidth,
                      binrange,
                      discrete,
                  )
              )
  
          bin_kws = dict(bins=tuple(bin_edges))
  
      if cache:
          self.bin_kws = bin_kws
  
      return bin_kws
  
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 3 for calling the Histogram obj's underlying member method code with example usage: obj.define_bin_params(x1, x2, weights, cache) and returns: bin_kws