This question already has an answer here:
- Non-repetitive random number in numpy 3 answers
I do this
import numpy as np
In [66]: np.random.choice(5, 3)
Out[66]: array([2, 3, 2])
If it possible to generate random numbers with numpy.random.choice without duplicates? If not, what is the best way to do it?
Aucun commentaire:
Enregistrer un commentaire