22. Exporting and Sharing Your Analysis
22.7 Practice, Tip and Close
Why. Export skill is judged when someone else opens your files — not when your notebook cell shows Out[42].
What. End-to-end share pack for a fictional Monday review.
How.
Chapter practice lab
- Create 25 fictional orders across the six Maharashtra cities (include Cancelled / Returned).
- Clean ₹ commas; save
data/clean/orders_clean.csv. - Build city×status summary; write CSV + multi-sheet Excel.
- Save one bar chart PNG of delivered GMV by city.
- Fill the one-page insight template (scope → ask).
- Run the pre-send checklist; fix anything that fails.
# Minimal stub to extend
import pandas as pd
from pathlib import Path
Path("data/clean").mkdir(parents=True, exist_ok=True)
Path("outputs").mkdir(exist_ok=True)
Path("figures").mkdir(exist_ok=True)
orders = pd.DataFrame({
"order_id": [f"BLK-261023-{i:03d}" for i in range(1, 6)],
"city": ["Pune", "Nashik", "Nagpur", "Kolhapur", "Solapur"],
"status": ["Delivered", "Delivered", "Returned", "Delivered", "Cancelled"],
"amount": ["220", "1,150", "95", "80", "60"],
"customer": ["Ravindra Bagale", "Zoya", "Raja", "Ravina", "Amir"],
})
orders["amount"] = (
orders["amount"].str.replace(",", "", regex=False).astype(float)
)
orders.to_csv("data/clean/orders_clean.csv", index=False)
Practice task
Zoya asks for “only Kolhapur and Solapur, Delivered, Excel”. Produce that sheet without touching data/raw/.
Ravindra Bagale's Tip
Phone var PNG + teen bullets; desktop var Excel. Donhi ready theva.
Thodkyaat sangaycha tar (quick recap)
- Managers need CSV / Excel / PNG, not kernels
to_csv/to_excel(+ openpyxl) for summariessavefig+ titles + units for WhatsApp- One-page template: scope → number → ask
- raw / clean / outputs / figures discipline
- Fix commas and encoding before you hit Send
Samajla ka? Aata pudhe jaauya common pandas mistakes and how to fix them without deleting half the data.