December 2017
Intermediate to advanced
386 pages
10h 42m
English
Run the following code in a Jupyter code cell:
from scipy.stats import normmmean, msdev = 70, 4.0fmean, fsdev = 65, 3.5mdist = norm(mmean, scale=msdev)fdist = norm(fmean, scale=fsdev)nm, nf = 2000, 1500mdata = mdist.rvs(size=nm)fdata = fdist.rvs(size=nf)plt.figure(figsize=(12, 4))plt.subplot(1,2,1)plt.hist([mdata, fdata], bins=20, label=['Males', 'Females'])plt.legend()plt.xlabel('Height (inches)')plt.ylabel('Frequency')plt.subplot(1,2,2)plt.boxplot([mdata, fdata], patch_artist=True, labels=['Males', 'Females'])None
Running this code will generate the following graph:

The two graphs clearly display the characteristics of a normal ...
Read now
Unlock full access