StatisticsSciPy 1.18 · pandas 3.0 · statsmodels 0.15 · Python 3.12 or 3.13
Dashboard
0%
1
Curious builder0 XP earned · 300 to level 2
0 daysFinish a lesson to begin
Badge collection0 of 6 unlocked
57 small wins to finish your pathNext lesson →

Descriptive and inferential statistics

Descriptive and inferential statistics are the two branches of statistics: descriptive statistics summarizes the data you have, and inferential statistics uses a sample to draw conclusions about the larger population it came from.

Last updated: 07 Oct, 2026 · SciPy 1.18

The overview, Statistics, named the two branches. Every method in the course belongs to one of them, so telling them apart is the first decision in any analysis: are you describing these numbers, or using them to say something about numbers you never collected?

Descriptive and inferential statistics · from the Complete Statistics for Data Science in 6 Hours video · 7:39 to 10:59

Asking a descriptive question

Descriptive statistics consists of organizing and summarizing data. The video's example is a classroom of maths students and their first-semester marks, in percent:

84, 86, 78, 72, 75, 65, 80, 81, 92, 95, 96, 97

"What is the average mark of the students in the class?" is a descriptive question. The answer comes from these 12 numbers alone. So do the other summaries the video lists: the mode, the standard deviation, or the percentage of students who passed. Tables and charts of the marks are descriptive too.

Asking an inferential question

Inferential statistics uses the data you have to form conclusions about data you do not have. The video's question: are the marks of the students of this classroom similar to the marks of the maths classrooms in the whole college? Say the college has five maths classrooms and only this one was measured. The five classrooms are the population and the one classroom is the sample.

Five maths classrooms make up the population and one class, with its 12 marks, is the sample; descriptive statistics summarizes those 12 marks, such as their mean of 83.42, while inferential statistics uses them to reach a conclusion about all the classrooms.

The answer to an inferential question is never certain, because the other classrooms were not measured. Inferential methods say how uncertain it is: a confidence interval gives a range for the population's average mark, and a hypothesis test says whether the sample is consistent with a claim about the population.

How much a sample can tell you depends on how it was chosen. One whole classroom is a group that was easy to take, not a random draw of students from the college; if that class has a stronger teacher, its marks say little about the others. Sampling techniques covers the ways to draw a sample that represents its population.

Summarizing the 12 marks in Python

The descriptive answers take one line each in pandas:

ExampleFrom the video, run on pandas 3.0.6
import pandas as pd

marks = pd.Series([84, 86, 78, 72, 75, 65, 80, 81, 92, 95, 96, 97])
print("count  :", marks.count())
print("mean   :", round(marks.mean(), 2))
print("median :", marks.median())
print("lowest :", marks.min(), "  highest:", marks.max())
print("spread from lowest to highest:", marks.max() - marks.min())

Reading the class summary

  • count 12: the board lists 12 marks.
  • mean 83.42: the answer to the video's descriptive question, the average mark of the class (1001 ÷ 12).
  • median 82.5: half the marks are below 82.5 and half above, the middle of 81 and 84 once the marks are sorted. Mean, median and mode explains when the two differ.
  • lowest 65, highest 97: the marks cover 32 points.
  • None of these numbers says anything certain about the other four classrooms. That step is inference.

Descriptive vs inferential statistics

Descriptive statisticsInferential statistics
QuestionWhat do these data look like?What do these data say about the population?
Data usedAll the data in handA sample, standing in for a population
AnswerExact for the data in handComes with a measured uncertainty
ToolsTables, charts, mean, median, mode, standard deviation, percentilesConfidence intervals, hypothesis tests, p-values, z, t, chi-square and ANOVA tests
The video's exampleAverage mark of the one classAre the marks similar across the college's maths classrooms?

Where you use descriptive and inferential statistics

  • A sales dashboard is descriptive: total sales, average order value and a chart per month, for the orders already placed.
  • An A/B test is inferential: a new checkout page is shown to a sample of visitors, and a test decides whether its higher sales would hold for all visitors or could be chance.
  • An exit poll is inferential: a sample of voters is asked, and the result is used to predict how the whole state voted, as Population and sample shows.
Watch out. A summary of a sample describes only that sample. Writing "students in this college score 83.42 on average" from one classroom turns a descriptive number into an inferential claim, and it needs a representative sample and an error margin before it holds.
Try it yourself
  • The notes use the ages of one of 20 maths classes instead: [21, 20, 18, 34, 17, 22, 24, 25, 26, 23, 22]. Put them in the Series. Is the mean 22.91 and the median 22?
  • Print marks.describe() for all the descriptive summaries at once.
  • Count how many marks are 80 or above with (marks >= 80).sum(), and turn it into a share with (marks >= 80).mean().

You understood something today that you didn't yesterday.