Statistical Thinking in Python (Part 1)
Justin Bois
Teaching Professor at the California Institute of Technology
import numpy as np
rng = np.random.default_rng()
mean = np.mean(michelson_speed_of_light)
std = np.std(michelson_speed_of_light)
samples = rng.normal(mean, std, size=10000)
x, y = ecdf(michelson_speed_of_light)
x_theor, y_theor = ecdf(samples)
import matplotlib.pyplot as plt
import seaborn as sns
sns.set()
_ = plt.plot(x_theor, y_theor)
_ = plt.plot(x, y, marker='.', linestyle='none')
_ = plt.xlabel('speed of light (km/s)')
_ = plt.ylabel('CDF')
plt.show()
Statistical Thinking in Python (Part 1)