Ravindra Bagale · Data Scienceसर्व coursesया course चे lessonsशोधाEnglish

Data Science · मराठी आवृत्ती

22.7 Practice, tip आणि close

By Ravindra Bagale

या course चे सर्व chapters (py + ch)

हे का शिकायचं?

एक summary → CSV + Excel + PNG + 5-line insight. ही पूर्ण share loop आहे.

हे काय आहे?

Practice नंतर quiz.

कसं करायचं?

Step 1. Summary table बनवा.

Step 2. to_csv आणि to_excel.

Step 3. एक chart savefig.

Step 4. Insight template भरा.

Step 5. Quiz द्या.

उदाहरणं: copy करा आणि चालवा

हा code / output:

# 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)