samedi 13 février 2021

How a random number is generated in Numpy if I don't use Generator or RandomState?

I have read the Doc of Numpy,but I still don't know how a random number is generated if I don't use Generator or RandomState. As far as I know,we can get a random number from 1 to 10 by

#use RandomState
print(np.random.RandomState().randint(1,10,(1)))
#use Generator
print(np.random.default_rng().randint(1,10,(1)))
#my question
print(np.random.default_rng().integers(1,10,(1)))

So how the random number is generated in the third way?




Aucun commentaire:

Enregistrer un commentaire