Exploratory Data Analysis
Beginner 12 min read Exploratory Data Analysis

Univariate Analysis

Meet every column as an individual

One variable at a time, told properly: categorical frequencies, numeric distributions, quantiles, and the story a histogram plus a box plot reveals.

histogrambox plotpercentilesvalue_countsskewdistribution
Prerequisites: The EDA Framework
Before we start

What you will learn

  • Summarize categoricals with value_counts
  • Read histogram + boxplot + stats together
  • Describe skew, spread and typical value per variable
Introduction

What is this?

Univariate analysis studies each column alone. Categoricals: value_counts with missing-aware normalization. Numerics: describe (mean, percentiles, std), a histogram of shape, and a box plot of spread and outliers. Reading them together tells you typical value, variability, skew, and clustering before any relationship is examined.

Motivation

Why do you need it?

  • A single column can discredit an analysis — negative prices, massive outliers, bimodal mixes.
  • Knowing each distribution informs which summary is honest (median vs mean).
  • Distribution shapes hint at transformations and model assumptions down the line.
  • It is the vocabulary every subsequent bivariate chart depends on.
Think about it

Mental model

Imagine

Reading each file in a cabinet before organizing the drawer

Think of

Univariate analysis

The archivist opens each folder (column), notes size, shape and odd pages before trying to file things by relation. Univariate is that per-file inspection — the folder's own story first.

Mechanics

How it works

  • Categorical: df[col].value_counts(dropna=False) shows frequencies including its 'missing' bucket.
  • Numeric: df[col].describe() gives count, mean, std, min, quartiles, max.
  • Histogram visualizes shape: bell, skewed, bimodal, uniform.
  • Box plot visualizes spread and fence-outliers at a glance.
  • Compare mean vs median: divergence means skew — mean-shown, median-true.
  • Log-scaling or bucketing reveals structure in heavy-tailed numeric columns.

One column, four views.

Counts
Stats
Hist
Box
Story
Hands-on

Examples

Reading one column like a pro

Reading one column like a pro
import numpy as np, pandas as pd
amt = pd.Series(np.random.default_rng(2).lognormal(3, 1.0, 500))
print((amt.describe())[['count','mean','50%','75%','max']].round(2))
print("mean vs median gap:", round(amt.mean() - amt.median(), 2))
print("skewed right -> report the median")

The mean-median gap is the skew tell: a log-normal column says 'median, not mean' as your headline.

Real world

In production

  • A funnel analyst finds 'billing amount' is multimodal (two plan tiers) and segments before any funnel math.
  • An ops dashboard reports p50/p95 latency from univariate inspection, not the mean.
  • A feature pipeline logs each column's skew to choose log-vs-lin transformations.
Guidelines

Best practices

  • Pair each numeric column with its histogram + box + describe in the same report block.
  • Report the median when mean-median diverge; say why.
  • Always mount dropna=False counts for categoricals so absence is visible.
  • Bucketed views (histogram bins) should adapt to the data, not default counts.
Watch out

Common mistakes

  • Summarizing a categorical with mean() and wasting the insight.
  • Ignoring bimodality that flags two populations blended together.
  • Reporting the mean of a heavy-tail column without the median.
  • Assuming the histogram is bell-shaped without actually squinting at it.
When things break

Debugging tips

  • A mean far outside the IQR range → look at the top 1% values, not the mean itself.
  • value_counts showing a 99% single value → near-constant column, drop from models.
  • Missing bucket visible → completeness problem, not a value problem.
  • Log-transform the histogram of money data; the shape usually snaps into focus.
Interviews

Interview checkpoint

Practice

Hands-on lab

Profile Every Column of a Churn File
30 min · beginner
In progress
Objectives
  • Classify each column as categorical or numeric
  • Summarize both with stats + counts
  • Write the 'want to report'/transformation notes

Profile Every Column of a Churn File

30 min · beginner

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

Quick quiz

0/2
1

Skew in a column is best detected by:

2

A bimodal histogram means every column must be normalized immediately.

Go deeper

Official documentation