class_docstr: Class which implements the function minimized by knuth_bin_width
  
  Parameters
  ----------
  data : array-like, one dimension
      data to be histogrammed
  
  Notes
  -----
  the function F is given by
  
  .. math::
      F(M|x,I) = n\log(M) + \log\Gamma(\frac{M}{2})
      - M\log\Gamma(\frac{1}{2})
      - \log\Gamma(\frac{2n+M}{2})
      + \sum_{k=1}^M \log\Gamma(n_k + \frac{1}{2})
  
  where :math:`\Gamma` is the Gamma function, :math:`n` is the number of
  data points, :math:`n_k` is the number of measurements in bin :math:`k`.
  
  See Also
  --------
  knuth_bin_width
  astroML.plotting.hist
code: def __init__(self, data):
      self.data = np.array(data, copy=True)
      if self.data.ndim != 1:
          raise ValueError("data should be 1-dimensional")
      self.data.sort()
      self.n = self.data.size
  
file_path: astroML/astroML/density_estimation/histtools.py
imports: import numpy
  from scipy.special import gammaln
  from astropy import stats
  from astroML.utils import deprecated
  from astroML.utils.exceptions import AstroMLDeprecationWarning
label_desc: Use image node_id 1 to create a new KnuthF object  with example: obj = KnuthF(data)