I am confused primarily on two points:
-
Why are there different random number generator functions in numpy that seemingly produce the same thing? e.g. np.random.rand() vs np.random.uniform(); or np.random.randn(), np.random.normal(), np.random.standard_normal()- [I mean, why is the standard_normal() function even a thing? It is longer to type than specifying the locus =0 and scale =1 in np.random.normal() ???]
-
What is the point of defining a random number generator at the beginning of a program, rng=np.default.random_rng() and then calling rng.normal(), rng.random() for each instance one wants to generate a random number, rather than using np.random.rand() and np.random.normal() etc in each case separately?
My idea is that it has something to do with how the random numbers are generated for both points, but I’m not at all sure.
Many thanks.