Statistical analysis of Black Friday transaction data to understand how gender, age, city, and marital status influence customer spending — and what Walmart should do about it.
Walmart wants to understand Black Friday purchase behaviour across demographic segments. The business question: do men and women spend differently? Does city type matter? Does age? The answers directly shape targeted promotions, inventory allocation, and marketing spend for the next Black Friday campaign.
| Segment | Avg Purchase (₹) | Key Insight |
|---|---|---|
| Male | 9,504 | Higher spender |
| Female | 8,734 | Lower spender |
| Age 51–55 | ~9,900 | Highest age group |
| Age 0–17 | ~8,100 | Lowest age group |
| City C | ~9,700 | Highest city |
| City A | ~9,100 | Second highest |
| Single | ~9,280 | Slightly higher |
| Married | ~9,250 | Very close |
from scipy import stats import numpy as np male_purchases = df[df['Gender']=='M']['Purchase'] female_purchases = df[df['Gender']=='F']['Purchase'] # 95% Confidence Interval for male purchases ci_male = stats.t.interval( 0.95, df=len(male_purchases)-1, loc=male_purchases.mean(), scale=stats.sem(male_purchases) ) # Output: (9487.2, 9520.8) # vs Female CI: (8719.4, 8748.6) — no overlap → significant