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.
docstr: Draw random variables from the distribution
  
  Parameters
  ----------
  shape : integer or tuple
      shape of desired array
  
  Returns
  -------
  rv : ndarray, shape=shape
      random variables
code: def rvs(self, shape):
      """Draw random variables from the distribution
  
      Parameters
      ----------
      shape : integer or tuple
          shape of desired array
  
      Returns
      -------
      rv : ndarray, shape=shape
          random variables
      """
      # generate uniform variables between 0 and 1
      y = np.random.random(shape)
      return interpolate.splev(y, self._tck)
  
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 2 for calling the EmpiricalDistribution obj's underlying member method code with example usage: obj.rvs(shape) and returns: interpolate