01 Statistics intro - Mean, median, & mode#

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

khanacademy appdividend

Statistics intro - Mean, median, & mode fig 1

x = np.array([4,3,1,6,1,7])
print(f'mean {np.mean(x)}')
print(f'median {np.median(x)}')
mode, count = stats.mode(x)
print(f'mode {mode[0]} count {count[0]}')
mean 3.6666666666666665
median 3.5
mode 1 count 2