Ravindra BagaleCourses & study guides मराठी Track your progress

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

  1. 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).
  2. Clean amounts (remove Indian commas) and parse dates with dayfirst=True.
  3. Print mean, median, Q1, Q3, IQR for amount overall and per city.
  4. Flag rows outside Q1 − 1.5×IQR / Q3 + 1.5×IQR; inspect, do not auto-drop.
  5. Histogram of amounts; save PNG under figures/.
  6. Compute corr between a numeric items column and delivery_mins; write one careful sentence.
  7. 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.