Master programming syntax, solve interactive challenges & run live code in Syntaxis Explore Arena →
menu_book Course Curriculum (SciPy) expand_more
SciPy / Statistics

chi-square test

Learn chi-square test in SciPy with a dedicated explanation, a concept-specific example, practical cautions, and a mastery check.

12 min read • Intermediate
scipy-021.py
python
from scipy.stats import chi2_contingency
table=[[30,20],[18,32]]
chi2,p,dof,expected=chi2_contingency(table)
print(chi2,p,dof)
What to watch
Content source & attribution
Original Syntaxis Content · Original Syntaxis Content