Reputation: 222
What is algorithm that Python Numpy uses to generate random numbers? More specifically, what is the algorithm that is used when we invoke
np.random.uniform()
Is Linear congruential generator
random generation technique being used? What happens when we type
np.random.seed(42)
and why are some numbers like 42 are more popular with np.random.seed
?
Upvotes: 1
Views: 1482
Reputation: 7111
random
module).42
is commonly chosen any time an arbitrary number needs to be picked, especially in nerdier social circles, because of its position as "the answer to life, the universe, and everything" according to a popular book. Other small, memorable numbers are often chosen for seeds as well.Upvotes: 4