21. Stats You Need for Data Work
21.7 Practice, Tip and Close
Why. Stats stick when you use them on one messy file end to end.
What. One mini lab tying Chapters 9–12 ideas to this chapter’s kit.
How.
Chapter practice lab
- Create 40 fictional Blinkit rows: cities Pune, Solapur, Nashik, Sambhaji Nagar, Kolhapur, Nagpur; amounts ₹50–₹1,500; two extreme gifts; dates in Oct 2026 (
dd-mm-yyyy). - Clean amounts (remove Indian commas) and parse dates with
dayfirst=True. - Print mean, median, Q1, Q3, IQR for
amountoverall and per city. - Flag rows outside Q1 − 1.5×IQR / Q3 + 1.5×IQR; inspect, do not auto-drop.
- Histogram of amounts; save PNG under
figures/. - Compute corr between a numeric
itemscolumn anddelivery_mins; write one careful sentence. - State your sample in one line at the top of the notebook.
# Starter skeleton — expand to 40 rows yourself
import pandas as pd
lab = pd.DataFrame({
"order_id": ["BLK-261021-001", "BLK-261021-002", "AMN-261021-003"],
"city": ["Pune", "Kolhapur", "Nagpur"],
"order_date": ["21-10-2026", "21-10-2026", "22-10-2026"],
"amount": ["1,250", "95", "180"],
"items": [12, 2, 4],
"delivery_mins": [22, 11, 14],
"customer": ["Ravindra Bagale", "Ravina", "Raja"],
})
lab["amount"] = (
lab["amount"].astype(str).str.replace(",", "", regex=False).astype(float)
)
lab["order_date"] = pd.to_datetime(lab["order_date"], dayfirst=True)
print(lab[["amount", "items", "delivery_mins"]].describe())
Ravindra Bagale's Tip
Stats toolkit chota theva: count, median, IQR, max, ani ek honest corr sentence. Chart nantar. Samajla ka?
Practice task
Send Shraddha Bagale a four-line WhatsApp (fictional): sample scope, median ₹, IQR, and one corr caution. No chart screenshot required for this task.
Thodkyaat sangaycha tar (quick recap)
- Stats before charts: count, median, spread
- Mean follows extremes; median is calmer for ₹
- IQR = middle 50% width; max needs a human eye
- Skew: festival right tails are normal in commerce
- Correlation ≠ causation — say association
- Name your sample (dates, cities, filters)
Samajla ka? Aata pudhe jaauya exporting and sharing — CSV, Excel, PNG and a one-page insight write-up.