title: ValueError: Sample larger than population selecting samples from graph
body: <p>I am trying to randomly select n samples from a graph. In order to do so I create a list called X using the random.sample function like the following:</p>
  
  <pre><code>X= random.sample(range(graph.ecount()), numPosSamples)
  </code></pre>
  
  <p>The problem is that when numPosSamples is equal to graph.ecount() I receive the following error:</p>
  
  <pre><code>ValueError: Sample larger than population
  </code></pre>
  
  <p>Any help will be much appreciated. Thanks</p>