16. End-to-End Project: Blinkit Maharashtra
16.2 Create the Raw Extract (Lab Data)
import pandas as pd
import numpy as np
rng = np.random.default_rng(42)
cities = ["Pune", "Solapur", "Nashik", "Sambhaji Nagar", "Kolhapur", "Nagpur"]
customers = [
"Ravindra Bagale", "Shraddha Bagale", "Ruhi Bagale",
"Shahrukh", "Amir", "Salman", "Zoya", "Ravina", "Raja", "Rani",
]
statuses = ["Delivered", "Delivered", "Delivered", "Delivered", "Cancelled", "Returned"]
rows = []
for i in range(1, 121):
city = cities[i % len(cities)]
day = 1 + (i % 30)
# Diwali window spike (fictional): days 15–22
base = 120 if 15 <= day <= 22 else 80
amount = int(base + rng.integers(20, 400))
if city == "Pune":
amount = int(amount * 1.2)
rows.append({
"Order ID": f"BLK-2610-{i:03d}" if i % 5 else f"AMN-2610-{i:03d}",
"Order Date": f"{day:02d}-10-2026",
"City": city if i % 17 else city.lower(), # occasional dirty case
"Amount": f"{amount:,}" if i % 11 else amount,
"Status": statuses[i % len(statuses)],
"Delivery Mins": int(rng.integers(8, 25)) if i % 19 else 999,
"Customer": customers[i % len(customers)],
"Store ID": f"{city[:3].upper()}-0{1 + (i % 3)}",
})
raw = pd.DataFrame(rows)
raw.to_csv("data/blinkit_maha_raw.csv", index=False)
raw.head()