Univariate Analysis
Distribution plots, histograms, box plots, count plots for individual feature understanding.
What Is Univariate Analysis?
Univariate analysis examines one variable at a time to understand its distribution: center, spread, shape, and unusual values.
The right plot depends on the variable type:
- Numeric → histogram, KDE, box plot, violin plot
- Categorical → count plot (bar chart of frequencies)
Setting Up the Plotting Libraries
We use Matplotlib (plt) and Seaborn (sns). Seaborn sits on top of Matplotlib with nicer defaults for statistical plots.
import matplotlib.pyplot as plt
import seaborn as sns
import pandas as pd
sns.set_theme(style="whitegrid")
df = pd.read_csv("data.csv")