from scipy.stats import norm
# What percentage of man are shorter than 154
mean = 161
standard_deviation = 7
from scipy.stats import norm
norm.cdf(154, mean, standard_deviation)
# Generate 10 random heights
mean = 161
standard_deviation = 7
from scipy.stats import norm
norm.rvs(mean, standard_deviation, size = 10)
import numpy as np
import matplotlib.pyplot as plt
def get_normal(n):
mu,sigma = 10,1
s = np.random.normal(mu, sigma, n)
plt.hist(s, density=True)
plt.show()
get_normal(100)
# What height are 90% of men are shorter than?
mean = 161
standard_deviation = 7
from scipy.stats import norm
norm.ppf(0.90, mean, standard_deviation)