lundi 28 août 2017

What is the exact nature of differences or similarities between random.setstate() and random.seed()

I have an understanding (on a very high level) about the usage of seed to generate the random numbers. so setting a particular seed prior to generating random numbers would result in generating the same numbers at each call.

I am assuming restoring the state by

import random
test123 = random.getstate()
random.setstate(test123)

would also result in the replication on random numbers by some similar process

i am looking for an understanding in their similarities and differences. For example: are setting the seed to some value and restoring the internal state of the generator via random.setstate(random.getstate()) certain methods in every situation for replicating random numbers?

there is not much documented about them that i could find




Aucun commentaire:

Enregistrer un commentaire