This question already has an answer here:
- Non-repetitive random number in numpy 3 answers
I would like to get an array of integers in a certain range. But every number must occur once. Is there a possibility to do this as a simple one liner or simple command ?
Till now I only found
np.random.choice(10,10)
or
np.random.randint(1,10,9)
But both of these functions do not give back a vector where every number only occurs once.
Hint: I know that Iam not allowed to ask for more numbers than there is compared to the range.
Aucun commentaire:
Enregistrer un commentaire