import numpy as np # import numpy
from scipy import stats # import stats sub-module
mean = 100
sigma = 2
p = stats.norm.cdf(95, mean, sigma)
print('probability = ',p)
This probability agrees with that given by H&H.
p = stats.norm.cdf(101, mean, sigma) - stats.norm.cdf(99, mean, sigma)
print('probability = ',p)
This probability agrees with that given by H&H.
%load_ext version_information
%version_information numpy, scipy