December 2017
Intermediate to advanced
386 pages
10h 42m
English
We will initialize a normal distribution with a given average and standard deviation. Once initialized, we will consider the output that we should be expecting.
Initializing a normal distribution
A normal variable with a given mean and standard deviation can be initialized by using the rvs function in scipy.stats.norm:
from scipy import stats
x = stats.norm.rvs(loc=3, scale=2, size=(1000))
In the preceding line of code, we have initialized a variable x, which has a mean value of 3, a standard deviation of 2, and a total size of 1,000.
Note that the mean is referred to as loc and the standard deviation as scale in the line of ...
Read now
Unlock full access