In this article we show how to generate NumPy arrays with random numbers.
NumPy provides a wide range of functions to generate random numbers in arrays. These functions are available in the numpy.random module.
The random numbers are generated using the same, excellent pseudo-random number generator called Mersenne Twister that is also used in the normal random module. Mersenne Twister has a period of 2^19937-1 and is generally regarded as a very good pseudo-random number generator (for non-cryptographic purposes).
Several functions for constructing random arrays are provided, including: