We can use the following Python code to generate n random values from the Gaussian distribution.
from scipy.stats import norm numbers = norm.rvs(size=10, loc=1, scale=2) print(numbers)
Here, the argument size specifies that we are generating 10 numbers from the normal distribution. The loc argument specifies the mean, and the scale argument specifies the standard deviation of the normal distribution.
The output of the given program will be like the following:
[ 5.70932236 3.18932964 1.35492583 -0.13228987 1.52736277 2.48195123 3.43682455 -2.72817594 4.51655757 1.488556 ]
0 Comments