I have a big script in Python. I inspired myself in other people's code so I ended up using the numpy.random
module for some things (for example for creating an array of random numbers taken from a binomial distribution) and in other places I use the module random.random
.
Can someone please tell me the major differences between the two?
Looking at the doc webpage for each of the two it seems to me that numpy.random
just has more methods, but I am unclear about how the generation of the random numbers is different.
The reason why I am asking is because I need to seed my main program for debugging purposes. But it doesn't work unless I use the same random number generator in all the modules that I am importing, is this correct?
Also, I read here, in another post, a discussion about NOT using numpy.random.seed()
, but I didn't really understand why this was such a bad idea. I would really appreciate if someone explain me why this is the case.