EDA with Visualization
Look before you leap to statistics
Charts are the fastest eyes on unfamiliar data: distributions as histograms, relationships as scatters, segments as grouped bars, and staggered layouts that compare quickly and honestly.
What you will learn
- Choose the right chart per question
- Use facets to compare segments in one shot
- Interpret charts adversarially (scales, counts, outliers)
What is this?
Exploratory visualization is fast, disposable and directed: histogram for shape, scatter for two numerics, bar/count for categories, box after stratifying, and small multiples (facets) when a third dimension matters. Good EDA charts are annotated with their question and read with suspicion about scale and ordering.
Why do you need it?
- Patterns and pathologies print faster than they compute.
- Segment-conditional charts reveal stories a single aggregate hides.
- Honest axes (zeroed bars, log scales) prevent misleading silhouettes.
- Charts from EDA become the first visual of the final report.
Mental model
A cartographer sketching a coast before sailing it
EDA visualization
The sketch identifies reefs, currents and havens in a glance, flags the dangerous fringe, and guides the voyage plan. EDA charts are the coastline sketch — cheap, directional, and they decide what to navigate seriously.
How it works
- Single numeric: histogram or box plot.
- Two numerics: scatter + trend line to see slope and outliers.
- Category counts: bar with value sort; avoid pie except for obvious wholes.
- Numeric by category: grouped box or violin shows full segment distributions.
- Facets: seaborn relplot/displot with col= or hue= split the story into small panels.
- Interrogate: check axis scale, bin width, and whether the look changes if you re-bin.
Question → chart → read.
Examples
Shape + pair + segment in one nibble
import numpy as np, pandas as pd, matplotlibmatplotlib.use("Agg")import matplotlib.pyplot as pltimport seaborn as snsrng = np.random.default_rng(11)df = pd.DataFrame({"plan": np.random.choice(["basic", "pro"], 200), "spend": np.round(rng.lognormal(2.2, 0.9, 200), 2)})fig, ax = plt.subplots(1, 2, figsize=(10, 4))sns.histplot(df.spend, kde=True, ax=ax[0])sns.boxplot(data=df, x="plan", y="spend", ax=ax[1])plt.tight_layout(); plt.savefig("eda.png")print("eda.png written with shape + segment views")One grid carries the spend histogram and the plan-segmented boxplot — the two essential views before any modeling.
In production
- A QA analyst eyeballs 20 candidate features as mini-histograms before feature selection.
- A growth team facets conversion by plan and channel in one small-multiples panel.
- An onboarding report leads with the spend-by-plan boxplot as its evidence anchor.
Best practices
- Title every EDA chart with the question it's answering.
- Use zeroed, consistent axes when comparing categories.
- Prefer small multiples over crowded single charts.
- Save charts with a consistent theme so the exploration becomes the first report.
Common mistakes
- Pie charts for multi-slice comparisons (hard to read, misleading colors).
- Bar charts with truncated y-axes inflating differences.
- Scatter plots of tens of thousands of points hiding density behind overplotting.
- Too many bins or too few — the histogram's shape changes with its window.
Debugging tips
- A 'skyline' histogram → bin width off; adjust bins or switch to KDE.
- A scatter full of ink → sample, add alpha, or hexbin to see density.
- Two panels that disagree → check which axis/scale differs.
- Colors illegible for the final output → run a quick accessibility check.
Interview checkpoint
Hands-on lab
- Build a grid: histograms, scatter, grouped box
- Use facets for a third dimension
- Annotate each chart with its takeaway
A Six-Chart EDA Grid
30 min · beginner
Quick quiz
The best chart for comparing spend distributions across plans jointly:
A histogram's apparent shape can change with bin width.