In this video, we will discuss the three functions in numpy that are used to generate random numbers: np.Random.rand, np.Random.randint, and np.Random.randn.
The np.Random.rand function generates random numbers from a uniform distribution between 0 and 1. It takes one or more arguments that specify the dimensions of the output array. For example, np.Random.rand(2, 3) would generate a 2x3 array of random numbers.
The np.Random.randint function generates random integers between two specified values, with the upper bound being exclusive. It also takes one or more arguments that specify the dimensions of the output array. For example, np.Random.randint(1, 10, size=(2, 3)) would generate a 2x3 array of random integers between 1 and 9.
The np.Random.randn function generates random numbers from a standard normal distribution with mean 0 and variance 1. It also takes one or more arguments that specify the dimensions of the output array. For example, np.Random.randn(2, 3) would generate a 2x3 array of random numbers from a standard normal distribution.
By using these functions, you can generate random numbers in numpy for various purposes, such as simulations, statistical analysis, and machine learning.