Mean, Median and Mode Explained Simply
Mean, median and mode are three basic statistics used to understand the “typical” value in a dataset.
They are essential for data analysis, machine learning and business reporting.
What Are Mean, Median and Mode?
When working with data, we often want to understand what is normal, common or typical.
Mean, median and mode help us summarise data using a single value.
| Measure |
Simple Meaning |
Best Used When |
| Mean |
The average value |
Data has no extreme outliers |
| Median |
The middle value |
Data contains outliers |
| Mode |
The most common value |
You want to find the most frequent item |
1. Mean
The mean is the average of all values. To calculate it, add all values together and divide by the number of values.
Mean = Sum of values ÷ Number of values
Example
Values: 10, 20, 30
Mean = (10 + 20 + 30) ÷ 3 = 20
The mean is useful when the data is fairly balanced. However, it can be affected by very large or very small values.
2. Median
The median is the middle value after sorting the data from smallest to largest.
Example
Values: 5, 10, 15, 20, 100
Median = 15
The median is often better than the mean when the data contains outliers.
Tip: If there are two middle values, add them together and divide by 2.
3. Mode
The mode is the value that appears most often in a dataset.
Example
Values: 2, 3, 3, 5, 8
Mode = 3
Mode is useful for categorical data such as product names, customer types or most selected options.
Mean vs Median: Why the Difference Matters
Consider the following salaries:
£25,000, £28,000, £30,000, £32,000, £150,000
The mean salary is pulled upward by the very high salary of £150,000.
The median gives a better idea of the typical salary in this case.
| Measure |
Result |
Interpretation |
| Mean |
£53,000 |
Affected by the high outlier |
| Median |
£30,000 |
More realistic typical salary |
Why Are These Important in Data Science?
Mean, median and mode are used regularly in data analysis and machine learning.
- Understanding typical values in a dataset
- Filling missing values
- Detecting outliers
- Summarising business data
- Preparing data for machine learning models
Python Example
You can calculate mean, median and mode using Pandas:
import pandas as pd
data = [10, 20, 30, 30, 100]
s = pd.Series(data)
print("Mean:", s.mean())
print("Median:", s.median())
print("Mode:", s.mode()[0])
Quick Practice
Find the mean, median and mode for the following data:
Answers:
- Mean = 6.8
- Median = 6
- Mode = 6
Key Takeaway
Mean, median and mode help us understand the central tendency of data.
The mean gives the average, the median gives the middle value, and the mode gives the most common value.
Simple rule: Use mean for balanced numerical data, median when outliers exist, and mode when finding the most common value.
Want to Learn More?
Explore our practical courses in Data Analysis, Machine Learning and AI to apply statistics in real-world projects.
View Courses