# Kenya CPI & Inflation Analysis (2024–2026)
**Exploratory Data Analysis | Python (Pandas, Matplotlib, Seaborn)**
## Overview
This project analyzes Kenya's Consumer Price Index (CPI) and inflation trends from 2024 to 2026, using KNBS-derived data covering 13 expenditure divisions across 29 months. The goal was to understand not just *how much* inflation changed, but *what was driving it* — which categories, and why.
**Data sources:**
- `master_analysis_csv.csv` — 377 rows: every month × every division, with weights and division-level MoM/YoY inflation (core dataset)
- `monthly_trend_csv.csv` — 29 rows: overall CPI, MoM/YoY inflation, core/non-core inflation per month
- `division_ranking_csv.csv` — 13 rows: per-division average/peak/lowest YoY inflation (used for validation)
---
## 1. Data Integrity Checks
Before any analysis, the dataset was validated for consistency:
- **No missing values** across all 377 rows in `master_analysis`.
- **Date consistency confirmed**: the 29 unique dates in `master_analysis` matched exactly with the 29 rows in `monthly_trend` (no gaps or mismatches).
- **Complete coverage per month**: 29 dates × 13 divisions = 377 rows exactly, confirming no missing division-month combinations.
- **Fixed basket weights**: each division's `weight` had only one unique value across all 29 months, confirming CPI basket weights are held constant over the tracking period (not recalculated monthly) — as expected for KNBS methodology.
- `report_date` was converted from string to datetime to enable proper time-series operations.
**Conclusion:** the dataset is clean and internally consistent, with no structural issues requiring correction before analysis.
---
## 2. Descriptive Statistics
Computed on `monthly_trend` (29 independent monthly observations, avoiding duplication from the division-level table):
| Metric | Mean | Std Dev | Min | Max |
|---|---|---|---|---|
| Overall CPI | 143.99 | 4.46 | 138.15 | 154.56 |
| YoY Inflation | 4.43% | 1.05 | 2 …