TutorialsPythonExploratory Data Analysis (EDA) Workflow

Exploratory Data Analysis (EDA) Workflow

A structured 6-step EDA process every data analyst should follow on every dataset

Exploratory Data Analysis (EDA) is the process of understanding a new dataset before building any model or report. It answers: What does this data look like? What are the distributions? Are there nulls or outliers? What relationships exist between columns? EDA is not optional — analysts who skip it make wrong assumptions and build misleading dashboards. This tutorial gives you a repeatable 6-step process.

Example

The 6-step EDA workflow
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns

df = pd.read_csv("dataset.csv")

# STEP 1 — Shape and structure
print(f"Rows: {df.shape[0]}, Columns: {df.shape[1]}")
print(df.dtypes)

# STEP 2 — Missing values
null_pct = (df.isnull().sum() / len(df) * 100).round(1)
print(null_pct[null_pct > 0].sort_values(ascending=False))

# STEP 3 — Descriptive statistics
print(df.describe())               # numeric columns
print(df.describe(include="O"))    # string columns (count, unique, top, freq)

# STEP 4 — Distributions (numeric)
df.select_dtypes(include="number").hist(figsize=(15, 8), bins=20)
plt.suptitle("Numeric Column Distributions")
plt.tight_layout()
plt.show()

# STEP 5 — Categorical value counts
for col in df.select_dtypes(include="O").columns:
    print(f"
{col}:")
    print(df[col].value_counts().head(10))

# STEP 6 — Correlation
sns.heatmap(df.select_dtypes(include="number").corr(), annot=True, fmt=".2f", cmap="coolwarm")
plt.show()
💡 Run this template on every new dataset before any cleaning or analysis. It takes 5 minutes and saves hours.

Key Points

  • EDA is iterative — findings in one step lead you to investigate more in another
  • describe(include="O") gives stats for string columns: count, unique values, most common value
  • df.hist() plots all numeric columns in one grid — fast first look at distributions
  • Univariate analysis (one column at a time) before bivariate (two columns together)
  • Always document your EDA findings — they inform how you clean and model the data

Practice Question

In the EDA workflow, what is df.describe(include="O") used for?