There is a program that needs to get 100 samples from 1000 randomly generated number distributed in [1, 500]
. How can do I randomly get the samples?
I wrote the following:
N = 1000
x = 1 + 500 * np.random.rand(N)
sp_x = random.sample(x, 100)
I am getting an error:
TypeError: Population must be a sequence or set. For dicts, use list(d).
Aucun commentaire:
Enregistrer un commentaire