We can use the following Python code to generate n random numbers from the exponential distribution.
from scipy.stats import expon numbers = expon.rvs(size=10, loc=1, scale=2) print(numbers)
Here, we are generating 10 random numbers from the exponential distribution. The loc argument specifies the mean, and the scale argument specifies the standard deviation of the exponential distribution.
The output of the above program will be like the following:
[2.19312404 2.00117232 1.25731191 2.67514769 7.36678437 3.99963501 1.07160847 1.7146354 1.84112514 1.95987579]
0 Comments