code: def freedman_bin_width(data, return_bins=False):
      r"""Return the optimal histogram bin width using the Freedman-Diaconis rule
  
      Parameters
      ----------
      data : array-like, ndim=1
          observed (one-dimensional) data
      return_bins : bool (optional)
          if True, then return the bin edges
  
      Returns
      -------
      width : float
          optimal bin width using Scott's rule
      bins : ndarray
          bin edges: returned if `return_bins` is True
  
      Notes
      -----
      The optimal bin width is
  
      .. math::
          \Delta_b = \frac{2(q_{75} - q_{25})}{n^{1/3}}
  
      where :math:`q_{N}` is the :math:`N` percent quartile of the data, and
      :math:`n` is the number of data points.
  
      See Also
      --------
      knuth_bin_width
      scotts_bin_width
      astroML.plotting.hist
      """
      return astropy_stats.freedman_bin_width(data, return_bins)
  
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 2 for calling a global function with example usage: freedman_bin_width(data, return_bins) and returns: astropy_stats