WeCodeAcademy

Quartiles, Percentiles and Outliers

A percentile is the value below which a given share of the data falls. The 50th percentile is the median. The quartiles Q1, Q2, Q3 are the 25th, 50th and 75th percentiles, and the interquartile range (IQR) is Q3 - Q1: the spread of the middle half.

A common rule marks a value as an outlier if it is more than 1.5 * IQR below Q1 or above Q3.

Examplepython
Open in editor »
Quick check

What share of the data lies between Q1 and Q3?

Your turn: write the code

Print the interquartile range (Q3 minus Q1) of the data.

Finish the quick check (and any code exercise) to complete this lesson, or mark it done yourself.

Tip: use the left and right arrow keys to move between lessons.