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
Keep two versions of every result ready: a PNG with three bullet points for people who read on a phone, and an Excel file for people who work on a desktop. Exports are part of the analysis, so do not leave them for the last minute. Name every file so the reader knows what is inside.
Ravindra Bagale's Tip – मराठी
प्रत्येक निकालाचे दोन versions तयार ठेवा: phone वर वाचणाऱ्यांसाठी तीन bullet points सह एक PNG, आणि desktop वर काम करणाऱ्यांसाठी एक Excel file. Export हा analysis चाच भाग आहे, नंतर करायची गोष्ट नाही. प्रत्येक file ला असं नाव द्या की वाचकाला आत काय आहे ते लगेच कळेल.
Ravindra Bagale's Tip – हिंदी
हर result के दो versions तैयार रखो: phone पर पढ़ने वालों के लिए तीन bullet points वाली एक PNG, और desktop पर काम करने वालों के लिए एक Excel file। Export को analysis का ही हिस्सा मानो, बाद का काम नहीं। हर file का ऐसा नाम रखो कि पढ़ने वाले को तुरंत पता चले कि अंदर क्या है।
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.