samedi 27 novembre 2021

How can I create a list similar to random.sample using numpy seed

I wanted to create a list(length of list 100) of unique random number from say range 0 to 100, such that no number repeats twice. I know I can do that it using random.sample()

block = random.sample(range(0,100),100)

But I wanted to use seed in this, so I wanted to use numpy random seed and generate 100 unique numbers from a given set.




Aucun commentaire:

Enregistrer un commentaire