Mean, median and mode are the three ways to answer one deceptively simple question: what is the typical value in this data? They are collectively called measures of central tendency, and choosing the wrong one is one of the most common ways analysts accidentally mislead their audience. Getting them right is a core skill you will use in every report.
Each measure has a precise definition and a situation where it shines. This page walks through all three, shows how a single outlier splits them apart, and gives you a clear rule for which one to report.
The three averages defined
The mean is the arithmetic average: add every value and divide by the count. If five sales are 4, 8, 6, 8 and 10, the sum is 36 and the mean is 36 / 5 = 7.2. The mean uses every data point, which makes it informative but also fragile, because a single extreme value shifts it.
The median is the middle value once the data is sorted. Sorting 4, 8, 6, 8, 10 gives 4, 6, 8, 8, 10, and the middle of five values is the third one, 8. With an even count you average the two middle values. The median cares only about position, not magnitude, so distant outliers do not move it.
The mode is the most frequently occurring value. In our list, 8 appears twice and everything else once, so the mode is 8. A dataset can have one mode, several, or none. The mode is the only average that works for categorical data like product names or cities.
A worked example showing the outlier effect
The clearest way to feel the difference is to watch an outlier drag the mean away from the median. Here is a small, illustrative sample of five monthly salaries.
import numpy as np
from scipy import stats
salaries = [30000, 32000, 35000, 38000, 200000]
print("mean: ", np.mean(salaries))
print("median:", np.median(salaries))
print("mode: ", stats.mode(salaries, keepdims=False).mode)
Expected output:
mean: 67000.0
median: 35000.0
mode: 30000
Check the mean by hand: 30000 + 32000 + 35000 + 38000 + 200000 = 335000, and 335000 / 5 = 67000. Now look at what happened. Four of the five people earn between 30,000 and 38,000, yet the mean is 67,000 — a figure nobody actually earns. The single 200,000 salary hauled the mean far above the pack. The median, 35,000, sits right in the middle of the realistic values and is the honest answer to "what does a typical person here earn?"
This is exactly why news reports quote median household income and median home prices. Means would be inflated by a handful of billionaires and mansions.
How analysts choose
The decision rule is short and worth memorizing:
- Symmetric data, no outliers: the mean is ideal because it uses all the information.
- Skewed data or outliers present: report the median, optionally alongside the mean so readers see the gap.
- Categorical data: the mode is your only option.
A quick diagnostic: compute both mean and median. If they are close, the data is roughly symmetric and either is fine. If the mean is noticeably higher than the median, the data is right-skewed (a long tail of large values). If the mean is lower, it is left-skewed. That gap is a free skewness detector you can eyeball in seconds.
import numpy as np
data = [30000, 32000, 35000, 38000, 200000]
gap = np.mean(data) - np.median(data)
print("mean minus median:", gap) # 32000.0 -> strong right skew
A positive gap of 32,000 confirms a heavy right skew, driven by the one large salary.
Common mistakes
Averaging an already-skewed metric. Reporting the mean response time or mean deal size when a few huge values dominate paints an overly rosy or alarming picture. Reach for the median whenever the tail is long.
Forgetting to sort before taking the median. The median is defined on sorted data. Taking the "middle of the list" without sorting gives a meaningless number. Libraries sort for you, but if you compute by hand, sort first.
Treating the mode as reliable on continuous data. Precise measurements like 7.31, 7.32, 7.33 rarely repeat, so the mode is either undefined or an accident of rounding. Save the mode for discrete or categorical values.
Reporting only one number. A single average hides variability. Pair any measure of center with a measure of spread from the variance and standard deviation tutorial so your audience knows how consistent the data is.
In interviews
This topic is a guaranteed interview warm-up. The classic question is "What is the difference between mean and median, and when would you use each?" The strong answer names outlier sensitivity: the mean is pulled by extreme values, the median is not, so skewed data calls for the median. Expect a live calculation too, such as "find the median of 3, 7, 2, 8, 5" — sort to 2, 3, 5, 7, 8 and read off 5. You may also be handed a scenario ("Average salary is far above the median — what does that tell you?") and asked to interpret it as right skew. Interviewers care that you can connect the numbers to a real decision, not just recite definitions.
Where this fits in your learning path
Mean, median and mode are the center half of descriptive statistics; the spread half lives in variance and standard deviation. Once you are comfortable summarizing a single column, percentiles and quartiles extend the idea to any position in the data, not just the middle. All of it sits inside the broader data analytics learning path, and these fundamentals are exactly what the data analyst roadmap expects you to have solid before interviews.
Frequently Asked Questions
What is the difference between mean and median?
When should I use the median instead of the mean?
Can a dataset have more than one mode?
How do you find the median of an even number of values?
Which average is best for categorical data?
Want to Build Your Career in Data Analytics with AI?
Join CodeBegun and train with working industry engineers — See the Data Analytics course in Hyderabad

