Data Science · Exploratory Data Analysis · EDA · Interactive sheet

The
EDA
Blueprint

Exploratory data analysis means looking at your data, with summaries and plots, before you trust any number or model built on it. You let the data show you its shape, its gaps and its surprises, and only then decide which questions to ask. Every number on this page is clickable. Every underlined term has a definition.

Before you startWhat a table of data is (rows are cases, columns are variables), what a mean and a median are, and a little Python. EDA is the first step before any model such as Linear Regression; for the bigger picture see Introduction to Machine Learning.

0.816
same r, 4 datasets
1.5 × IQR
outlier fence
1977
Tukey's EDA book
866
missing cells, Titanic
68·95·99.7
normal rule, %
01

Same numbers, different stories

Summary statistics squeeze a whole column into one number, and very different data can share the same numbers. Anscombe's quartet proves it: pick a dataset and compare its statistics with its plot.
dataset

9
mean of x
7.50
mean of y
0.816
correlation r
y = 3.00 + 0.500x
fitted line

The headline

Identical summary statistics do not mean identical data. That is why every analysis starts with EDA: look at the distribution, the gaps and the odd values first, then decide what to calculate.

timeline · click a chip
1973 Anscombe 1977 Tukey 2017 Datasaurus
02

Walk a messy dataset through EDA

Thirteen student records with hours studied, sleep, attendance, group and exam score, plus the usual problems. Drag the scrubber, click a stage bead or press play to see the table, the counts and the Python line at each stage.
inspect clean explore
students.csv100%
stage scrubber1 · load
Legend: red = missing, violet = duplicate row, amber = outlier, green = filled or corrected.
inspect

rows
13
missing
3
issues
0
Quick check
The raw file has 13 rows. One row is an exact duplicate and one row has no exam score, which is the column you want to explain. After dropping both, how many rows are left?
13 − 1 duplicate = 12, then − 1 row without the target = 11. Missing sleep and attendance values are filled with the column median instead, because those rows still carry a real score.
03

Three ideas that make EDA work

Robust summaries that one wild value cannot drag, plots whose shape depends on how you draw them, and correlation that measures only straight-line togetherness. Play with each one.

Idea 1 · The median resists outliers, the mean does not

ten house prices (RM thousand) · drag the last house
price of house 10450
mean
0
median
0

Idea 2 · A histogram depends on its bins

minutes 200 customers spent in a shop · same data, different bins
number of bins9
k = ⌈log₂ n⌉ + 1 = 9

Idea 3 · Correlation measures straight-line togetherness

strength of the relationship0.6
0.60
sample correlation r (computed from the 60 points)
r = cov(x, y) ÷ (sₓ · s_y)

Quick check
Five salaries are 3, 3, 4, 5 and 5 (RM thousand). The last one is changed to 50. What happens?
Mean before: 20 ÷ 5 = 4. After: (3 + 3 + 4 + 5 + 50) ÷ 5 = 65 ÷ 5 = 13. The sorted middle value is still the third one, 4. That is why EDA reports the median next to the mean.
04

The defining rule: Tukey's 1.5 × IQR fence

EDA flags a value as a suspected outlier when it lies beyond the fences Q1 − 1.5·IQR and Q3 + 1.5·IQR. Compare it with the z-score rule |z| > 3 and watch where each one fails.
strip plot · IQR fences (red) vs z-score limits (violet)100%
IQR rule
1
z-score rule
0
sample size n12
value of the suspect point80
fence multiplier k1.5
z threshold t3
fences = Q1 − k·IQR , Q3 + k·IQR
z = (x − x̄) ÷ s , flag if |z| > t

Why the z-rule can miss. In a sample of n values no point can have |z| larger than (n − 1) ÷ √n, because the point inflates the very standard deviation it is measured with (masking). With n = 10 that ceiling is 2.85, so |z| > 3 can never fire.

Quick check
Exam scores have Q1 = 40 and Q3 = 60. With Tukey's rule (k = 1.5), above which score is a value flagged?
IQR = 60 − 40 = 20. Upper fence = Q3 + 1.5 × IQR = 60 + 30 = 90. Lower fence = 40 − 30 = 10.
05

Five-number summary, by hand and by eye

The five-number summary (min, Q1, median, Q3, max) is what a box plot draws and what df.describe() prints. Do one by hand, then type any numbers into the calculator.

Worked example by hand: seven delivery times (minutes)

data, as collected
sorted, position 0 to 6
Press Next step to start.

Quartiles here use the pandas default (linear interpolation): the p-th quantile sits at position p · (n − 1) of the sorted list. Textbooks sometimes use the "median of each half" method, which can give slightly different quartiles.

IQR = Q3 − Q1 · fences = Q1 − k·IQR , Q3 + k·IQR · h = p·(n − 1)
fence multiplier k1.5
IQR
4.5
box plot of your numbers · hover a dot100%
Quick check
Sorted data: 2, 4, 6, 8, 10. Using position p · (n − 1), what is the IQR?
n − 1 = 4. Q1 sits at position 0.25 · 4 = 1 → value 4. Q3 at 0.75 · 4 = 3 → value 8. IQR = 8 − 4 = 4. Type 2, 4, 6, 8, 10 into the calculator to check.
06

Where the missing values add up

The Kaggle Titanic training file has 891 passengers and 12 columns. Its 866 empty cells sit in just three columns. Click a bar for the arithmetic and the usual fix; switch to see each column's own share.
100%
numeric columncategorical / text column
click a bar

The arithmetic and the usual fix for that column appear here.

Missing by column type

What dropna() would do

complete rows left of 891

Worked example: counting the gaps

All cells in the table
891 rows × 12 columns = 10,692 cells
Cabin, the worst column
687 ÷ 891 = 77.1 % of the column is empty → usually dropped, or reduced to "has cabin: yes / no"
Age, a numeric column you need
177 ÷ 891 = 19.9 % empty → fill with the median age (28), better per class and sex
Embarked, almost complete
2 ÷ 891 = 0.2 % → fill with the most common port, S (the mode)
Total, and share of the whole table
687 + 177 + 2 = 866 · 866 ÷ 10,692 = 8.1 % of all cells

In Python one line gives the bars above: df.isna().sum(). Divide by len(df) for the shares.

Quick check
A column has 45 empty cells in a table of 900 rows. What share of the column is missing?
45 ÷ 900 = 0.05 = 5 %. Small enough to fill (median for numbers, mode for categories), and worth adding a "was missing" flag if the gaps might mean something.
07

The family of EDA plots

Which plot you need depends on how many variables you look at and whether they are numeric or categorical. Filter the table, set how many columns your data has, and load a technique into the walker.
columns in your data p12
techniquevariablestypesrevealsplots for p
technique

Click a row.

Quick check
You want to see whether exam score rises with hours studied (both numeric). Which plot do you draw first?
Two numeric variables → scatter plot. It shows direction, strength, curves and odd points in one view; the correlation r is the one-number summary you compute afterwards.
08

The cost and the limits of looking

Looking is cheap for a small table and breaks down for a wide one: the number of column pairs grows with p², and at α = 0.05 some of them will look "significant" by pure chance. Set the size of your data and see what it costs.
rows n10,000
numeric columns p20
significance level α
seconds to read one plot10
table in memory
column pairs
chance "findings"
smallest "significant" |r|
time to see every pair
pair plot panels
Quick check
Your data has 20 numeric columns that are, in truth, all unrelated. You test every pair at α = 0.05. About how many pairs look "significant"?
Pairs = 20 × 19 ÷ 2 = 190. Each has a 5 % chance of a false alarm: 190 × 0.05 = 9.5. Set p = 20 above to see the same number.
09

Apply EDA yourself in Python

An eight-step checklist you can run on any new table with pandas and seaborn. Click a step to highlight its code; tick them off as you go.

Checklist progress

0 of 8 steps doneclick a step twice to tick it

        
Quick check
What does df.isna().sum() return?
isna() turns the table into True / False (True = missing); .sum() adds the Trues column by column, because True counts as 1. The result is one count per column, exactly the bars of section 06.
10

History: from Playfair to pandas

Statistical graphics are more than two centuries old; the idea that looking should come before testing was named by Tukey in 1977, and software made it routine. Click a point for the story.
milestones by kind · graphics, statistics, software100%
click a point

Before and after Tukey: confirmatory vs exploratory · tap a card to flip

Quick check
Why did Anscombe build four datasets with identical statistics?
The statistics are correct for all four sets; they simply cannot tell a line from a curve or a single outlier. Anscombe's point (1973) was that graphs are a necessary part of analysis, the same message as Tukey's book four years later.
11

Where EDA is used today

Every field that collects data runs EDA before it decides anything: to find errors, to spot the unusual and to pick the right model. Click each row.
Sales per day, basket sizes and return rates. Histograms reveal that most baskets are small with a long right tail; time plots show weekly and festive-season patterns; box plots per store expose a branch whose returns are far above the others.
Patient records arrive with gaps and impossible values (an age of 230, a blood pressure of 0). EDA finds them, counts missing lab results per hospital and checks that groups are comparable before any study result is trusted.
Transaction amounts are heavily skewed, so analysts look at them on a log scale and use robust, IQR-style rules per customer. A payment far outside a customer's usual range is an outlier worth a second look, the same idea as section 04.
Before training, EDA checks class balance (on the Titanic file 342 of 891 passengers survived, 38.4 %), finds columns that leak the answer (leakage), and decides scaling and encoding. A model is only as good as the table it is fed.
Sensor readings per machine and per shift are compared with box plots; a drifting median or a widening IQR warns of wear long before parts fail inspection.
Tools such as ydata-profiling (formerly pandas-profiling) and Sweetviz produce a full report of types, gaps, distributions and correlations in one call. They speed up the inspect stage, but deciding what a strange value means still needs a person who knows the data.
Quick check
A bank flags card payments that lie far outside a customer's usual spending. Which EDA idea is that?
"Far outside the usual range" is the definition of an outlier. Banks use robust ranges such as the IQR per customer, so one big past purchase does not stretch the ruler.
12

Key takeaways

Seven sentences to remember. Click each for the evidence.
Anscombe's four datasets share mean x = 9, mean y ≈ 7.50, r ≈ 0.816 and y ≈ 3.00 + 0.500x, yet look completely different. Section 01.
Shape and types, missing and duplicates, then describe, outliers, correlation and groups. Write down every change you make. Sections 02 and 09.
One extreme value drags the mean but barely moves the median. A large gap between them signals skew or an outlier. Section 03.
The IQR rule is robust; the |z| > 3 rule can be masked by the outlier itself, and cannot fire at all when n ≤ 10. Flag, investigate, then correct or keep. Sections 04 and 05.
Titanic: 866 empty cells in three columns; dropna() would keep only 183 of 891 rows. Drop, impute or flag column by column. Section 06.
One numeric: histogram or box plot. One categorical: bar chart of counts. Two numeric: scatter. Many: heatmap or pair plot. Section 07.
Correlation is not causation, and scanning p(p − 1) ÷ 2 pairs produces chance findings. Confirm what you find on new data. Sections 03 and 08.
13

Check your understanding

Five questions, instant feedback, every answer explained. Score 4 or more and the stamp is yours. Click a dot to jump to a question.
0 / 5
■ STAMPED · EDA BLUEPRINT · APPROVED
14

Glossary

Every term used on this page. Type to filter; click a term to open its definition.