title: Sampling data points from a Gaussian Mixture Model python
body: <p>I am really new to python and GMM. I learned GMM recently and trying to implement the codes from <a href="https://jakevdp.github.io/PythonDataScienceHandbook/05.12-gaussian-mixtures.html" rel="nofollow noreferrer">here</a></p>
  <p>I met some problems when I run gmm.sample() method:</p>
  <pre><code>gmm16 = GaussianMixture(n_components=16, covariance_type='full', random_state=0)    
  Xnew = gmm16.sample(400,random_state=42)
  plt.scatter(Xnew[:, 0], Xnew[:, 1])
  </code></pre>
  <p>the error shows:</p>
  <pre><code>TypeError: sample() got an unexpected keyword argument 'random_state'
  </code></pre>
  <p>I have checked the latest document and find out the method sample should only contain n which indicates that the number of samples to generate. But when I delete 'random_state=42', new error appears:</p>
  <p>codes:</p>
  <pre><code>Xnew = gmm16.sample(400)
  plt.scatter(Xnew[:, 0], Xnew[:, 1])
  </code></pre>
  <p>error:</p>
  <pre><code>TypeError: tuple indices must be integers or slices, not tuple
  </code></pre>
  <p>Does anyone meet this problem when you implement the codes from Jake VanderPlas? How could I fix it?</p>
  <p>My Jupyter:</p>
  <blockquote>
  <p>The version of the notebook server is: 5.7.4</p>
  <p>Python 3.7.1 (default, Dec 14 2018, 13:28:58)</p>
  <p>Type 'copyright', 'credits' or 'license' for more information</p>
  <p>IPython 7.2.0 -- An enhanced Interactive Python. Type '?' for help.</p>
  </blockquote>