class_docstr: Empirically learn a distribution from one-dimensional data
  
  Parameters
  ----------
  data : one-dimensional array
      input data
  
  Examples
  --------
  >>> import numpy as np
  >>> np.random.seed(0)
  >>> x = np.random.normal(size=10000)  # normally-distributed variables
  >>> x.mean(), x.std()
  (-0.018433720158265783, 0.98755656817612003)
  >>> x2 = EmpiricalDistribution(x).rvs(10000)
  >>> x2.mean(), x2.std()
  (-0.020293716681613363, 1.0039249294845276)
  
  Notes
  -----
  This function works by approximating the inverse of the cumulative
  distribution using an efficient spline fit to the sorted values.
code: def __init__(self, data):
      # copy, because we'll need to sort in-place
      data = np.array(data, copy=True)
      if data.ndim != 1:
          raise ValueError("data should be one-dimensional")
      data.sort()
  
      # set up spline
      y = np.linspace(0, 1, data.size)
      self._tck = interpolate.splrep(y, data)
  
file_path: astroML/astroML/density_estimation/empirical.py
imports: import numpy
  from scipy import interpolate
  from sklearn.utils import check_random_state
label_desc: Use image node_id 1 to create a new EmpiricalDistribution object  with example: obj = EmpiricalDistribution(data)