statistics

Statistics tutorials covering core concepts, calculations, and analysis with Python.

Statistics: Hypothesis Testing with t-test and chi-square

Perform hypothesis testing in Python: null and alternative hypotheses, p-values, t-tests (one-sample, independent, paired), chi-square, and a decision tree for choosing the right test (including where ANOVA fits) in this hypothesis testing python guide. “To call in the statistician after the experiment is done may be no more than asking him to perform a post-mortem examination.” Ronald Fisher, Statistical Methods Last Updated: July 2026 | Tested on: Python 3.14.6, SciPy 1.18.0 | Difficulty: Advanced | Reading Time: 16 minutes Your ... Read More

Statistics: Correlation & Regression Analysis

Python correlation and regression measure how two variables move together: Pearson and Spearman correlation, correlation matrices, simple linear regression from scratch and with SciPy, R-squared, and residual analysis, every number run on real code. “Correlation does not imply causation, but it does waggle its eyebrows suggestively.” Randall Munroe, xkcd Correlation answers one simple question: when one number goes up, does the other one tend to go up too, go down, or just do its own thing? Regression goes one step ... Read More

Statistics: Descriptive (Mean, Median, Mode, Std Dev)

Python descriptive statistics summarize a whole dataset in a handful of numbers: where the center sits (mean, median, mode), how scattered the values are (variance, standard deviation, percentiles), and what shape the data has (skewness, kurtosis). This post calculates all of them by hand first, then with scipy and Pandas. “We don’t have better algorithms. We just have more data.” Peter Norvig Last Updated: July 2026 | Tested on: Python 3.14.6, SciPy 1.18, Pandas 2.3.3 | Difficulty: Intermediate | Reading ... Read More