07 Central limit theorem#

%%html
<iframe width="700" height="400" src="https://www.youtube.com/embed/JNm3M9cqWyc/" frameborder="0" allowfullscreen></iframe>
import random
import numpy as np
import pandas as pd
from pandas import Series, DataFrame
import matplotlib.pyplot as plt
import seaborn as sns
from scipy import stats, special

khanacademy

Central limit theorem fig 1Central limit theorem fig 2Central limit theorem fig 3Central limit theorem fig 4

population = range(1, 7)
dist = [np.mean(random.sample(population, k=4)) for _ in range(600)]
sns.distplot(dist)
/opt/hostedtoolcache/Python/3.9.13/x64/lib/python3.9/site-packages/seaborn/distributions.py:2619: FutureWarning: `distplot` is a deprecated function and will be removed in a future version. Please adapt your code to use either `displot` (a figure-level function with similar flexibility) or `histplot` (an axes-level function for histograms).
  warnings.warn(msg, FutureWarning)
<AxesSubplot:ylabel='Density'>
../_images/07 Central limit theorem_7_2.png