Exploratory Data Analysis
Beginner 12 min read Exploratory Data Analysis

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.

histogramscatterbarboxfacetseabornexploration
Prerequisites: The EDA Framework
Before we start

What you will learn

  • Choose the right chart per question
  • Use facets to compare segments in one shot
  • Interpret charts adversarially (scales, counts, outliers)
Introduction

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.

Motivation

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.
Think about it

Mental model

Imagine

A cartographer sketching a coast before sailing it

Think of

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.

Mechanics

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.

Question
Chart
Facet
Interrogate
Finding
Hands-on

Examples

Shape + pair + segment in one nibble

Shape + pair + segment in one nibble
import numpy as np, pandas as pd, matplotlib
matplotlib.use("Agg")
import matplotlib.pyplot as plt
import seaborn as sns
rng = 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.

Real world

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.
Guidelines

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.
Watch out

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.
When things break

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.
Interviews

Interview checkpoint

Practice

Hands-on lab

A Six-Chart EDA Grid
30 min · beginner
In progress
Objectives
  • 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

0/4 steps
0%
sandbox · Linux sandbox
$
Try these commands
Test yourself

Quick quiz

0/2
1

The best chart for comparing spend distributions across plans jointly:

2

A histogram's apparent shape can change with bin width.

Go deeper

Official documentation