Apply Now Apply Now Apply Now
header_logo
Post thumbnail
DATA SCIENCE

Exploratory Data Analysis in Data Science: Step-by-Step Guide

By Lukesh S

Exploratory Data Analysis (EDA) is the process of examining a dataset using statistics and visuals before you build any model. It helps you spot missing values, outliers, and relationships between variables so your machine learning model isn’t built on shaky data.

Here’s what EDA in data science typically involves:

  • Checking data structure with df.info() and df.describe()
  • Finding and handling missing values
  • Visualizing distributions with histograms and box plots
  • Spotting correlations with a heatmap
  • Detecting outliers before modeling
  • Studying relationships between variables (bivariate and multivariate analysis)

Table of contents


  1. TL;DR Summary
  2. Why Exploratory Data Analysis Still Matters in 2026?
  3. EDA Checklist: 10 Steps Before Every ML Project
  4. EDA Walkthrough Using the Titanic Dataset
    • Step 1: Load and inspect the data
    • Step 2: Summary statistics with df.describe()
    • Step 3: Check missing data
    • Step 4: Visualize distributions with plt.hist()
    • Step 5: Correlation heatmap with sns.heatmap()
    • Step 6: Bivariate check
  5. Common EDA Mistakes Data Scientists Make
  6. Conclusion
  7. FAQs
    • What is EDA in data science?
    • Which Python libraries are used for EDA?
    • Is EDA necessary before every machine learning project?
    • What is the difference between EDA and data cleaning?
    • Which dataset is best for practicing EDA as a beginner?
    • How long does it take to learn EDA?

TL;DR Summary

EDA in data science is the step where you explore a raw dataset to understand its shape, quality, and patterns before modeling. You use tools like df.describe(), sns.heatmap(), and plt.hist() to check distributions, missing values, and correlations. Skipping EDA is one of the most common reasons machine learning models underperform in production.

mock test horizontal banner placement success

Why Exploratory Data Analysis Still Matters in 2026?

Most data science tutorials jump straight to model building. That’s a mistake.

A model trained on unexamined data will quietly learn from missing values, duplicate rows, and outliers you never caught. EDA is where you catch these problems while they’re still cheap to fix.

💡 Did You Know?

Data scientists spend close to 80% of their project time on data preparation and exploration, not on building the actual model, according to widely cited industry surveys on data science workflows.

If you’re building your EDA skills from scratch, HCL GUVI’s Data Science Course covers Pandas, NumPy, and visualization tools with real projects.

EDA Checklist: 10 Steps Before Every ML Project

EDA Checklist: 10 Steps Before Every ML Project

Run through this before you touch a single model:

  1. Load the dataset and check its shape with df.shape
  2. Preview rows using df.head() and df.tail()
  3. Check data types with df.info()
  4. Get summary statistics with df.describe()
  5. Count missing values with df.isnull().sum()
  6. Check for duplicate rows with df.duplicated().sum()
  7. Plot distributions for numeric columns using plt.hist()
  8. Visualize correlations using sns.heatmap()
  9. Detect outliers using box plots or the IQR method
  10. Study relationships between key variables (bivariate analysis)

Keep this list open in a second tab the first few times. It becomes muscle memory fast.

MDN

EDA Walkthrough Using the Titanic Dataset

EDA Walkthrough Using the Titanic Dataset

Theory only takes you so far. Here’s EDA applied to the Titanic dataset, a common beginner dataset for classification problems.

Step 1: Load and inspect the data

python

import pandas as pd

df = pd.read_csv('titanic.csv')
df.head()
df.info()

This tells you column names, data types, and how many non-null values each column has.

Step 2: Summary statistics with df.describe()

python

df.describe()

For the Titanic dataset, this instantly shows you that the average passenger age is around 29 to 30, fares are heavily right-skewed, and Age has missing values that need handling.

Step 3: Check missing data

python

df.isnull().sum()

The Age and Cabin columns usually show the most missing values in this dataset. This decides whether you impute, drop, or flag them as a separate category.

Step 4: Visualize distributions with plt.hist()

python

import matplotlib.pyplot as plt

df['Fare'].hist(bins=30)
plt.title('Fare Distribution')
plt.xlabel('Fare')
plt.ylabel('Passengers')
plt.show()

This shows most passengers paid low fares, with a long tail of expensive first-class tickets, a classic sign you’ll need to handle skew before modeling.

Step 5: Correlation heatmap with sns.heatmap()

python

import seaborn as sns

sns.heatmap(df.corr(numeric_only=True), annot=True, cmap='coolwarm')
plt.title('Correlation Heatmap')
plt.show()

On Titanic, this usually reveals that Pclass and Fare are moderately correlated with Survived, which is a strong early signal for feature selection.

Step 6: Bivariate check

python

sns.boxplot(x='Survived', y='Age', data=df)
plt.show()

A quick box plot like this can reveal whether age had any real relationship with survival, or whether it’s mostly noise.

If you’re working with a housing price dataset instead, the exact same six steps apply. Swap Survived for SalePrice, and the heatmap step becomes even more important since housing data usually has many correlated numeric features.

Common EDA Mistakes Data Scientists Make

  1. Skipping the missing value check: Jumping straight to visualization without running df.isnull().sum() first often leads to silently biased charts and models.
  2. Ignoring outliers: A handful of extreme values can distort your mean, correlation, and even your model’s decision boundary. Always look before you decide to keep or remove them.
  3. Reading df.describe() only for numeric columns: Categorical columns need their own check with df['col'].value_counts(). Skipping this hides class imbalance problems.
  4. Treating EDA as a one-time step: New features, joins, or cleaned versions of the data all deserve a fresh round of EDA. Don’t assume your first pass still applies.
  5. Overplotting without a question: Making twenty charts without asking what you’re checking for wastes time. Every plot should answer something specific.

Want to practice EDA on real datasets with guided feedback? HCL GUVI’s Data Analytics Using Pandas course walks through exactly this kind of workflow.

Conclusion

EDA is not a box to tick before modeling, it’s the step that decides whether your model is trustworthy. Running through df.describe(), missing value checks, histograms, and a correlation heatmap on every new dataset takes minutes but saves hours of debugging later. Start applying this checklist on a Kaggle dataset like Titanic or Housing Prices, and it will quickly become second nature.

FAQs

What is EDA in data science?

EDA, or Exploratory Data Analysis, is the process of examining a dataset using statistics and visualizations to understand its structure, quality, and patterns before building a model.

Which Python libraries are used for EDA?

Pandas for data handling, Matplotlib and Seaborn for visualization, and NumPy for numerical operations are the most commonly used libraries for EDA.

Is EDA necessary before every machine learning project?

Yes. Skipping EDA often means models are trained on missing values, outliers, or unbalanced classes that go unnoticed until the model underperforms in production.

What is the difference between EDA and data cleaning?

Data cleaning fixes issues like missing values and duplicates. EDA is the broader process of exploring the data, which often uncovers the issues that data cleaning then fixes.

Which dataset is best for practicing EDA as a beginner?

The Titanic dataset and the Boston or Ames Housing dataset are commonly used for beginners because they’re small, well documented, and have a mix of numeric and categorical features.

MDN

How long does it take to learn EDA?

With consistent practice on two or three real datasets, most beginners get comfortable with core EDA steps like df.describe(), histograms, and correlation heatmaps within two to three weeks.

Success Stories

Did you enjoy this article?

Schedule 1:1 free counselling

Similar Articles

Loading...
Get in Touch
Chat on Whatsapp
Request Callback
Share logo Copy link
Table of contents Table of contents
Table of contents Articles
Close button

  1. TL;DR Summary
  2. Why Exploratory Data Analysis Still Matters in 2026?
  3. EDA Checklist: 10 Steps Before Every ML Project
  4. EDA Walkthrough Using the Titanic Dataset
    • Step 1: Load and inspect the data
    • Step 2: Summary statistics with df.describe()
    • Step 3: Check missing data
    • Step 4: Visualize distributions with plt.hist()
    • Step 5: Correlation heatmap with sns.heatmap()
    • Step 6: Bivariate check
  5. Common EDA Mistakes Data Scientists Make
  6. Conclusion
  7. FAQs
    • What is EDA in data science?
    • Which Python libraries are used for EDA?
    • Is EDA necessary before every machine learning project?
    • What is the difference between EDA and data cleaning?
    • Which dataset is best for practicing EDA as a beginner?
    • How long does it take to learn EDA?