"You scored in the 90th percentile." That single phrase says nothing about the average or the spread, it tells you exactly where you stand in the crowd. That is a measure of position.
In the Measures of Dispersion chapter we used quartiles to measure spread (the IQR). Here we use the same machinery backwards, to locate a single value. The gap Q3 − Q1 was our spread measure; now Q1 itself is a landmark on the map.
Percentiles & Percentile Rank
These two are constantly confused, so pin them down. They are inverse operations:
A cut point: the value at a given position.
- "The 90th percentile is a score of 1350."
- Question: what value sits here?
A percentage: how much of the data is at or below a value.
- "A score of 1350 has a rank of 90."
- Question: what position does this value hold?
One picture shows both at once. Plot the cumulative percentage (how much of the data is at or below each value) and you get a rising S-curve, the ogive. Read up from a value to get its rank; read across from a percentage to get the percentile:
Quartiles, Deciles & Quantiles
Quartiles and deciles are not separate topics, they are just percentiles at round numbers. The umbrella word is quantile: a cut point that divides sorted data into equal-sized groups.
Quartiles
Cut into 4 parts at the 25th, 50th, 75th percentiles (Q1, Q2, Q3).
Deciles
Cut into 10 parts at the 10th, 20th, … 90th percentiles.
Percentiles
Cut into 100 parts, the finest standard grain.
The median is the 50th percentile = 2nd quartile (Q2) = 5th decile, the same point named three ways. And the five-number summary (min, Q1, median, Q3, max) is just the 0th, 25th, 50th, 75th, and 100th percentiles, a quick position map of the whole dataset.
Percentiles in the Real World
Position is how the world reports where you stand:
Standardized tests
"1350, the 90th percentile" means about 90% scored at or below you.
Growth charts
A baby in the 25th percentile for weight is at or above 25% of peers.
Income brackets
"The top 1%" is the 99th percentile of income, a position, not an amount.
"90th percentile" is not "90% correct." It is a ranking relative to others, not a grade out of 100. And a higher percentile is not automatically "better": a child steady at the 25th percentile is perfectly healthy. For growth, the trend over time matters far more than any single number.
Two Things Worth Knowing
When a percentile falls between two data points, software has to choose how to fill the gap. Some methods snap to the nearest actual value (nearest-rank), others blend the two neighbors (linear interpolation, NumPy's default). Excel, R, and calculators can each report slightly different quartiles for the same small dataset. None is wrong, just report your method.
Because percentiles depend only on rank order, not on how extreme a value is, a single billionaire barely nudges the median income or the quartiles, even though it would send the mean soaring. That is why skewed data (income, home prices) is described with percentiles.
There is one more way to express position, how many standard deviations a value sits from the mean (the z-score). Unlike percentiles, it is built on the mean and SD and shines for bell-shaped data. We get to it in the Standardization chapter.
Position in Machine Learning & AI
Locating a value within its distribution, its percentile or z-score, is exactly what several standard preprocessing steps and monitoring rules do under the hood.
| Measure of position | Where it shows up in ML | Why |
|---|---|---|
| z-score | Standardization (StandardScaler): the position of each value in SD units | Most models need features centered and scaled, and the z-score is precisely that position |
| Quartiles / IQR | Robust scaling (RobustScaler) and quantile binning | Scaling by the IQR instead of the SD resists outliers; binning by quantile makes equal-sized groups |
| Percentile rank | Anomaly thresholds and service-level targets (p95, p99 latency) | Flagging the top 1% or reporting the 95th-percentile response time are percentile rules by another name |
When a dashboard reports p95 latency or a monitor fires on the top 0.1% of transaction amounts, it is using percentile rank as a threshold. Position turns a raw number into a decision: is this value normal, or is it out at the tail where you should act?
Real-World Example: Exam Scores and Percentile Ranks
Position is what turns a bare test score into something meaningful. On this set of 400 exam scores, a raw 85 means little on its own, but knowing it sits at the 92nd percentile (a z-score of about +1.4) tells the whole story. The companion notebook finds the quartiles, the IQR, and any score's percentile rank and z-score.
One row per student: student_id, cohort (Morning or
Evening), and exam_score out of 100. A small group of low scorers gives a mild left tail, so the
quartiles and percentile ranks describe the class more faithfully than the average alone.
Bring it to life in Python
The companion notebook does the value↔rank round trip, computes quartiles and deciles, draws the cumulative S-curve, shows position resisting an outlier, and compares percentile calculation methods.
View opens the rendered notebook instantly (no setup). Open in Colab runs &
edits it live in your browser. To run locally, install numpy, pandas, matplotlib
and launch jupyter notebook.
🎓 Key Takeaways
- ✓Measures of position locate a single value within the data by its rank.
- ✓Percentile (a value) and percentile rank (a %) are inverse operations.
- ✓Quartiles, deciles, percentiles are all quantiles; the median is the 50th percentile = Q2 = 5th decile.
- ✓"90th percentile" is a ranking, not a grade, and a higher percentile is not always "better."
- ✓Percentiles are robust to outliers, but calculation methods can differ on small samples.
Practice Challenges
Five short challenges. Beginner to intermediate; try them on paper or in Python. Several use this dataset:
[55, 60, 62, 68, 70, 72, 75, 80, 85, 90].
Percentile rank
For the dataset above, what is the percentile rank of the score 70 (the
percent of scores at or below it)?
Percentile value
What score sits at the 80th percentile of the same dataset?
np.percentile do it.Quartiles & a decile
Find Q1, the median (Q2), Q3, and the 3rd decile (30th percentile) of the dataset.
Interpret it correctly
A pediatrician says a toddler is in the 30th percentile for height. What does that mean, and is it a problem?
Two valid answers
For [3, 6, 9, 12], compute the first quartile (25th percentile) two ways: NumPy's
"lower" method and its default "linear" method. Why do they differ?
A fully-worked solutions notebook walks through all five challenges in the same visual style. Try them yourself first, then compare.
Quiz: Test Yourself
Eight quick questions on position. Answer them, hit Check Answers, and keep refining until you score 100%. Your progress is saved, so you can hop back to the chapter and return anytime.