We can use the following Python code to generate n random values from the uniform distribution:
from scipy.stats import uniform numbers = uniform.rvs(size=10, loc=-1, scale=1) print(numbers)
Here, the size argument specifies that we are generating 10 random numbers from the uniform distribution. The loc argument specifies the mean of the uniform distribution. And the scale argument specifies the standard deviation of the uniform distribution.
The output of the above program will be like the following:
[-0.60250247 -0.48807334 -0.61130832 -0.71440832 -0.58122546 -0.9188319 -0.06100767 -0.5017389 -0.8741687 -0.09792219]






0 Comments