from scipy import stats
pv1 = stats.ttest_1samp(tree, 400) #One-Sample T-test
pv2 = stats.ttest_ind(neuti_tree, cherry_tree).pvalue #Two-Sample T-test
from scipy.stats import chisquare
from scipy.stats import chi2_contingency
print(chisquare(obs, axis=None)) # One sample chi-square
print(chi2_contingency(obs2, correction = False))
print(chi2_contingency(obs2, correction = True))#2 Sample chi-square
🔎 # 결과해석
# 1 : $\chi^2$ statistic
# 2 : p-value
# 3 : degree of freedom
# 4 : expected value for Observed
from scipy.stats import f_oneway
f_oneway(g1, g2, g3)