- 卡方分析--独立性检验
from scipy.stats import chi2_contingency
obs = np.array([[77, 784], [453, 6011]])
g, p, dof, expctd = chi2_contingency(obs)
g, p, dof, expctd
(3.9552675787097162,
0.046724889095159094,
1L,
array([[ 62.29761092, 798.70238908],[ 467.70238908, 5996.29761092]]))