Summary numbers hide as much as they reveal. A picture of your data exposes its shape, spread, gaps and outliers instantly — which is why every analysis should start with a chart, not a formula. This chapter covers the core statistical graphics.
Why plot first?
Two datasets can share the same mean and standard deviation yet look completely different — one symmetric, one skewed, one with a wild outlier. Plotting is how you catch that before it corrupts a model.
Histograms & box plots
- A histogram shows the distribution of one variable — is it symmetric, skewed, bimodal? Where's the peak?
- A box plot summarises the median, quartiles (the box) and outliers (points beyond the whiskers) — great for comparing groups.
import matplotlib.pyplot as pltdf["package"].hist(bins=20) # shape of the distributionplt.show()df.boxplot(column="package", by="programme") # compare groups + outliers
Scatter plots
A scatter plot shows the relationship between two numeric variables — the first thing to check before correlation or regression:
df.plot.scatter(x="experience", y="package")# Look for: direction (up/down), strength (tight/loose), shape (linear/curved), outliers.
Why summaries aren't enough
Practice
On a dataset, plot a histogram of one numeric column and note its shape and skew. Make a box plot comparing a metric across groups and identify outliers. Then scatter two variables and describe the relationship's direction, strength and shape.
Key takeaways
- 01Always plot data before modelling — charts reveal shape, spread and outliers that summaries hide.
- 02Histograms show one variable's distribution (symmetry, skew, modes).
- 03Box plots summarise median/quartiles/outliers and compare groups.
- 04Scatter plots reveal the direction, strength and shape of a two-variable relationship.
- 05Identical summary stats can hide wildly different data (Anscombe's quartet).
