I'm trying to set the seed for a few lines of code in a jupyter notebook.
However, when I tried running numpy.random.seed(0) in the initial cell, in the later cells the random generator was not 'seeded'. I had to write a set seed in all the cells where I was running the random draws... Why is that? Is there a way to avoid having to write the same thing in every cell where I have a random draw?
Also, I checked the numpy documentation and it seems that numpy.random.seed()
is not the best practice. I don't understand the example given there... How would I go about, according to the best practices shown in the example, in order to do something similar to numpy.random.seed(constant)
?