For data science you need five areas of statistics: descriptive statistics (mean, median, spread), probability and distributions, sampling and uncertainty (confidence intervals), hypothesis testing (including what p-values do and don't mean), and relationships between variables (correlation and regression). These let you describe data honestly, tell signal from noise, and evaluate models properly.

Why does statistics matter in data science?

Data is always a sample of something bigger and always noisy. Statistics is the toolkit for reasoning about that noise. Without it, you might celebrate a model that only got lucky on one test set, launch a feature based on a random fluctuation, or describe "typical" customers using an average distorted by a few outliers. With it, you can say how confident you are and why.

What are the descriptive statistics you'll use daily?

Take ten students' scores out of 100: 45, 52, 58, 60, 61, 63, 65, 68, 70, 98.

MeasureValueWhat it tells you
Mean64.0Average; pulled up by the 98
Median62.0Middle value; robust to outliers
Range53Max minus min; very sensitive to extremes
Interquartile range≈ 10Spread of the middle half of the data
Standard deviation (sample)≈ 14.0Typical distance from the mean

The gap between mean (64) and median (62) hints at a skew caused by one high score. For skewed data such as incomes, house prices or delivery times, the median usually describes the "typical" case better. Always look at a histogram or box plot as well as the numbers; our EDA guide shows how.

Which probability distributions matter most?

DistributionShape / useExample
NormalSymmetric bell curveMeasurement errors, many averages
BinomialCount of successes in n yes/no trialsNumber of users who click out of 1,000 shown
PoissonCount of events in a fixed intervalSupport tickets per hour
UniformAll outcomes equally likelyA fair die; random initialisation
Log-normal / skewedLong right tailIncomes, transaction values

The normal distribution's "68–95–99.7 rule" is worth memorising: about 68% of values lie within one standard deviation of the mean, 95% within two and 99.7% within three.

Share of a normal distribution within k standard deviations of the mean
Within ±1σ68.3%
Within ±2σ95.4%
Within ±3σ99.7%

Mathematical property of the normal distribution.

Why does the central limit theorem matter?

The central limit theorem says that the average of many independent samples tends towards a normal distribution, whatever the shape of the original data (given reasonable conditions). That is why confidence intervals and many tests work even for skewed data, as long as samples are large enough. It also explains why averages are more stable than single observations: the standard error of a mean shrinks with the square root of the sample size.

How do sampling and confidence intervals work?

If 120 of 1,000 visitors sign up, the sample conversion rate is 12%. The true rate for all visitors is uncertain. A 95% confidence interval (here roughly 10% to 14%) is a range produced by a method that captures the true value in 95% of repeated samples. Bigger samples give narrower intervals: to halve the width, you need about four times the data. Bias matters as much as size, though: 10,000 responses from only one city can't describe all of India.

What is hypothesis testing, and what does a p-value mean?

A hypothesis test asks whether an observed difference could easily be due to chance. You start with a null hypothesis ("the new page converts no better than the old one"), compute a test statistic, and get a p-value: the probability of seeing a difference at least this large if the null hypothesis were true. Common misunderstandings:

  • A p-value is not the probability the null hypothesis is true.
  • "Not significant" does not mean "no effect"; the sample may be too small.
  • A tiny p-value with a huge sample can describe a difference too small to matter. Always report the effect size.
  • Testing many things and reporting only the significant ones ("p-hacking") produces false discoveries.

A/B testing in product teams is exactly this process, and it's one of the most common practical uses of statistics in industry.

How do correlation and regression relate?

Correlation measures how strongly two variables move together, from −1 to +1. It says nothing about cause: ice-cream sales and drowning incidents both rise in summer. Regression goes further and models how one variable changes with others, which is the foundation of predictive modelling. Linear regression is often the first machine learning model people learn precisely because it sits at this meeting point of statistics and ML.

What is Bayes' theorem, and why is it useful?

Bayes' theorem updates a probability when you get new evidence. Classic example: a test for a rare condition (1 in 1,000 people) that is 99% accurate. If someone tests positive, the chance they actually have the condition is only about 9%, because false positives from the 999 healthy people outnumber true positives. This "base rate" reasoning matters in fraud detection, medical screening and any classifier working on imbalanced data, and it's why precision and recall matter more than accuracy there.

How do you avoid fooling yourself with data?

Statistics is as much about avoiding traps as computing numbers. Common ones in real projects:

  • Simpson's paradox: a trend that appears in every group can reverse when groups are combined, because group sizes differ. Always check results within meaningful segments.
  • Survivorship bias: analysing only the customers who stayed, or the startups that survived, hides why others left or failed.
  • Regression to the mean: an extreme week is usually followed by a more ordinary one, so don't credit or blame the last change too quickly.
  • Leakage: using information that wouldn't be available at prediction time makes models look far better than they are.

What statistics shows up in machine learning?

Many machine learning ideas are statistics in disguise. A train/test split is a sampling design. Cross-validation estimates how a model will perform on new data and how much that estimate varies. Logistic regression outputs probabilities, and calibration checks whether "70% likely" really happens about 70% of the time. Regularisation trades a little bias for lower variance. Even large language models are trained to maximise the probability of the next token. Engineers who understand these connections debug models faster, because they can tell a real improvement from noise in their own evaluation results.

Which Python tools help with statistics?

NumPy and Pandas compute descriptive statistics in one line each. SciPy's scipy.stats module provides distributions and common tests: t-tests, chi-square tests and correlation tests. Statsmodels fits regression models with full statistical output, including coefficients, confidence intervals and p-values, which is useful when you need to explain a relationship rather than only predict. For visual checks, histograms, box plots and Q-Q plots in Matplotlib or Seaborn show quickly whether data looks normal, skewed or full of outliers. Learn to compute each statistic in code and to read the output critically: knowing when a number can't be trusted is the skill that separates analysts from people who run functions.

In what order should you learn statistics for data science?

  1. Descriptive statistics and visualisation.
  2. Probability rules and common distributions.
  3. Sampling, the central limit theorem and confidence intervals.
  4. Hypothesis tests and A/B testing.
  5. Correlation and linear regression.
  6. Bayesian reasoning and probability in machine learning models.

Learn each with code: compute every statistic in Python on a real dataset rather than only by hand. In Program Zero, statistics is taught alongside NumPy, Pandas and machine learning in the data science course, with the maths you need introduced when you need it.