0–5 min
Real Hook
5–25 min
Core Concept
25–45 min
Live Coding
45–55 min
You Code It
55–60 min
Cheat Sheet
🔥 Real-World Hook (0–5 min)

A Swiggy data scientist built a delivery-time model that predicted negative times. The bug? One city's distances were stored in miles, all others in km. The model learned nonsense.

Exploratory Data Analysis (EDA) — looking at your data before modelling — would have caught it in 2 minutes. Bad data beats good models every time.

📈 Core Concepts (5–25 min)

💡 Pandas in 4 Operations

load — pd.read_csv() turns a file into a DataFrame.
explore — df.describe(), df.info(), df.isnull().sum().
filter & select — df[df["score"] > 80], df[["name","score"]].
aggregate — df.groupby("city")["sales"].mean().

💻 Live Demo — Student Grade EDA (25–45 min)

>import pandas as pd
import numpy as np

# Create a sample dataset (in real life: pd.read_csv("grades.csv"))
df = pd.DataFrame({
    "name":    ["Priya", "Ravi", "Ananya", "Kiran", "Divya"],
    "city":    ["Chennai", "Mumbai", "Chennai", "Mumbai", "Bengaluru"],
    "math":    [88, 72, 95, 60, 85],
    "science": [76, 85, 90, 55, 92],
    "grade":   ["B", "B", "A", "C", "A"]
})

# 1. Quick overview
print(df.describe())          # mean, std, min, max per column
print(df.isnull().sum())    # missing values per column

# 2. Filter: students who passed both subjects
passed = df[(df["math"] >= 60) & (df["science"] >= 60)]
print(passed[["name", "grade"]])

# 3. Groupby: average score by city
city_avg = df.groupby("city")[["math", "science"]].mean().round(1)
print(city_avg)

# 4. Add derived column
df["avg"] = (df["math"] + df["science"]) / 2
df["result"] = df["avg"].apply(lambda x: "Pass" if x >= 60 else "Fail")
print(df[["name", "avg", "result"]])

📋 You Code It (45–55 min)

✍ Task

Add a 6th student with a missing math score (use None). Find how many nulls exist. Fill the null with the column mean. Then filter students with avg >= 75 and print their names.

⚡ Day 3 Cheat Sheet

pd.read_csv("file.csv")
Load CSV as DataFrame
df.describe()
Stats summary
df.isnull().sum()
Count missing per column
df.fillna(df.mean())
Fill nulls with mean
df[df["col"] > 60]
Filter rows
df.groupby("col").mean()
Aggregate by group
df["new"] = df["a"] + df["b"]
Derived column
df.sort_values("col")
Sort DataFrame