liveBook · Manning

Quartile

As explained in Statistics Every Programmer Needs

A quartile is a quantile that divides ordered observations into four equal parts.

A quartile divides ordered numeric observations into four equal parts. Pandas describe() reports the three commonly used cut points: Q1 at 25%, Q2 at 50%, and Q3 at 75%. section 4.2.1

Use quartiles to inspect the distribution of numeric columns alongside other summary measures:

  • Q1 marks the 25th percentile, Q2 the median, and Q3 the 75th percentile. section 4.2.1
  • Quartiles complement the mean, standard deviation, minimum, and maximum when visual inspection alone is insufficient. section 4.2.1

Pandas summary

For the 20-record mds dataset, describe() reports stage1 quartiles of 165.75, 190.00, and 221.25, and stage2 quartiles of 199.00, 255.00, and 289.00. section 4.2.1

>>> import pandas as pd
>>> mds = pd.read_csv('mds.csv')

Load the dataset with pandas before computing quartiles through describe(). section 4.2.1

How Statistics Every Programmer Needs covers it

How deep it goes
Defines three percentile cut points and demonstrates their computed output, but does not derive the calculation algorithm.
Examples
Uses pandas describe() on the 20-record mds dataset, reporting quartiles for stage1 and stage2.
What it assumes
Assumes numeric observations and basic data-frame inspection while explaining quartile positions through summary output.
What you can do after
Apply quartile summaries through pandas describe() when inspecting numeric data.
How it connects
Connects quartiles with percentiles, the median, mean, standard deviation, minimum, and maximum.

Also explained in

Compare how 4 books explain quartile →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Statistics Every Programmer Needs. The section links point to the parts of the book it draws on.