title: Error: random_sample() takes at most 1 positional argument (2 given)
body: <p>I have an issue with random.sample function. Here is the code:</p>
  
  <pre><code>import random
  import numpy as np
  
  
  simulateData = np.random.normal(30, 2, 10000)
  
  meanValues = np.zeros(1000)
  
  for i in range(1000):
  
  
      dRange = range(0, len(simulateData))
      randIndex = np.random.sample(dRange, 30)
      randIndex.sort()
      rand = [simulateData[j] for j in randIndex]
      meanValues[i] = rand.mean()
  </code></pre>
  
  <p>This is the error:</p>
  
  <pre><code>TypeError                                 Traceback (most recent call last)
  &lt;ipython-input-368-92c8d9b7ecb0&gt; in &lt;module&gt;()
   20 
   21     dRange = range(0, len(simulateData))
  ---&gt; 22     randIndex = np.random.sample(dRange, 30)
   23     randIndex.sort()
   24     rand = [simulateData[i] for i in randIndex]
  
  mtrand.pyx in mtrand.RandomState.random_sample   (numpy\random\mtrand\mtrand.c:10022)()
  
  TypeError: random_sample() takes at most 1 positional argument (2 given)
  </code></pre>
  
  <p>I found several past references where such an error was supposedly addressed via changing import order like in my case above (random, before numpy). Supposedly random module gets overwritten somehow during the import while I can not imagine why would that be in a high level language. However in my case it did not work. I tried all possible variations but came with no solution</p>
  
  <p>The problem in itself is an attempt to bootstrap: get random samples (equal size) from the initial distribution and measure the mean and std.</p>
  
  <p>I am puzzled, especially since the solution which is supposed to work does not. I have Python 2.7</p>
  
  <p>Please, help</p>