Contents
Mean, Median and Mode
Mean, median, and mode are three ways to describe a dataset's typical value. They often give different answers, so the measure you choose affects how you interpret the data.
Mean
The mean is the sum of all values divided by the count.
x̄ = Σxᵢ / n
- x̄ (x-bar): the mean. It is the value each observation would have if the total were shared equally among all of them.
- xᵢ: each individual observation in the data.
- Σ (sigma): an instruction to add up all the values.
- n: the number of observations.
Median
The median is the middle value of a sorted dataset. If there is an even number of values, it is the average of the two middle ones.
Mode
The mode is the value that appears most often. A dataset can have one mode, several modes, or none.
Example: Seven employees have monthly salaries (in thousands): 30, 32, 32, 36, 38, 40, 250. Find the mean, median and mode.
- Mean: (30 + 32 + 32 + 36 + 38 + 40 + 250) / 7 = 458 / 7 ≈ 65.4
- Median: the sorted list has 7 values, so the 4th value is the median: 36.
- Mode: 32 appears twice, and no other value repeats, so the mode is 32.
The mean of 65.4 is higher than six of the seven salaries because one extreme value of 250 pulled it up. The median stays at 36 and still describes a typical employee. Without the 250, the mean of the remaining six values would be 208 / 6 ≈ 34.7.
Choosing Between Them
Measure | Works best for | Weakness |
| Mean | Numerical data with no extreme values | Pulled strongly by outliers |
| Median | Skewed data or data with outliers | Ignores the exact size of most values |
| Mode | Categorical data, such as the most common payment method | May be missing or not unique |
This choice matters when a column has missing values to fill. Replacing blanks in an income column with the mean pushes every filled value toward the few very high earners, while the median gives a more realistic fill.
Probability and Statistics for Data Science
Abhishek Pati








