A full exploratory data analysis (EDA) of a customer dataset: audit data quality, clean it, profile customer segments, quantify relationships, test a churn hypothesis, and tell the data story with clear visualizations. This is the day-to-day work of a data scientist — explore, find insight, communicate it.
⚠️ Uses synthetic data with deliberately embedded structure (so the insights are real and reproducible); works on any customer CSV via--csv.
- Data-quality audit — per-column dtype, missing values, uniqueness, and flags. Catches a real issue: a few impossible ages (−1, 0, 250).
- Cleaning — impossible ages → median imputation.
- Segment profiling — spend, tenure, engagement, and churn by segment.
- Correlation analysis — relationships among age, tenure, spend, engagement.
- Hypothesis test — does higher engagement reduce churn? (Churn by quintile.)
- Visualization — four presentation-ready charts saved to
outputs/.
| Finding | Evidence |
|---|---|
| Segments are distinct | Premium avg spend $395 & churn 15% vs Budget $117 & churn 45% |
| Spend grows with tenure | corr(tenure, spend) = +0.40 |
| Engagement curbs churn | corr(engagement, churn) = −0.26; lowest quintile churns 53% vs 17% for the highest |
Recommendation: invest in early engagement to lift retention and lifetime value.
![]() |
![]() |
![]() |
![]() |
pip install -r requirements.txt
python examples/run_eda.py # synthetic data + charts + narrative
python examples/run_eda.py --csv customers.csv # your own datapython tests/test_analysis.pyConfirms the audit detects bad ages, cleaning fixes them, segments are distinct, and the embedded relationships (tenure→spend positive, engagement→churn negative) are recovered.
src/
data_loader.py # CSV loader + synthetic customer generator
analysis.py # quality audit, cleaning, segment & correlation analysis
plots.py # presentation-ready charts
examples/
run_eda.py # full EDA pipeline with a written narrative of findings
outputs/ # generated charts
tests/
test_analysis.py
- Add a Jupyter notebook walkthrough with inline commentary
- Build a churn-prediction model on the cleaned features
- Interactive dashboard (Plotly / Streamlit)



