lundi 20 avril 2015

ValueError: Sample larger than population selecting samples from graph

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:

X= random.sample(range(graph.ecount()), numPosSamples)

The problem is that when numPosSamples is equal to graph.ecount() I receive the following error:

ValueError: Sample larger than population

Any help will be much appreciated. Thanks




Aucun commentaire:

Enregistrer un commentaire