Is Delhi's inflation different? A CPI project with MoSPI data
In this article (7 sections)
Related programme: the Data Analytics with Generative AI course (3–4 months; ₹90,000 (inclusive of GST) · EMI from ₹4,000/month).
MoSPI publishes the Consumer Price Index by state, sector and item group, so you can test a question people in NCR often argue about: does Delhi's inflation run hotter or cooler than India's, and which kinds of spending cause the difference? This project downloads Delhi and all-India CPI from MoSPI's eSankhyiki portal. It computes year-on-year inflation for the headline and each group, then decomposes the gap into group contributions using weights. The finished piece is a clear chart and a table a business reader can use, built on arithmetic you can defend line by line.
Where the data lives
Open MoSPI's eSankhyiki CPI page. Each macro-indicator page has Table, Chart, API and Metadata tabs, plus a Download button. The current series has base year 2024. The table we observed carried these columns:
| Column | Notes |
|---|---|
| Base Year, Series | Which index series the row belongs to |
| Year, Month | Reference period |
| State | All India or a state/UT, for example Delhi |
| Sector | Rural, Urban or Combined |
| Division, Group, Class, Sub Class, Item | The classification hierarchy |
| Code | Classification code |
| Index | Index value, base year = 100 |
| Inflation (%) | Year-on-year change as published |
| Imputation | Flag for imputed values |
For orientation: the page showed the all-India Combined General index at 108.74 for August 2026, with inflation of 4.82%. Check the Metadata tab for the item weights by state and sector. You need them for the decomposition, and weights differ between Delhi and all-India.
Allow the page a few seconds to load before the table appears. It is a JavaScript application.
Why an employer would care
Retail chains, FMCG companies and consumer lenders in NCR plan prices, wages and credit limits around local cost-of-living movements. An analyst who can say "Delhi's inflation was lower than India's this year mainly because of food, and here is the arithmetic" is useful in pricing, finance and strategy teams. The project also shows that you read metadata before charting, which many portfolio projects skip.
Cleaning issues to expect
- Base year changes. The current series uses 2024 = 100. Any earlier series used a different base. Never put index levels from two bases on one axis. Compare inflation rates, or link the series with a stated method.
- Short history on the new base. With a 2024 base, year-on-year inflation from the index itself only begins a year after the base period. Use the published Inflation (%) column where your own calculation is not possible, and say which you used.
- Sector choice. Delhi is overwhelmingly urban. Comparing Delhi Combined with India Combined mixes a regional difference with an urban–rural difference. Also compare Delhi Urban with India Urban.
- Imputed values. Filter or flag rows where Imputation is set, and count them.
- Hierarchy duplication. Divisions, groups, classes and items are all in one table. Filter to one level before you sum anything.
The computation, on a synthetic sample
The index values and weights below are synthetic, invented to show the method. They are not MoSPI figures.
import pandas as pd
rows = []
groups = {"Food and beverages": (0.40, 0.46), "Housing": (0.18, 0.10),
"Transport": (0.14, 0.12), "Other": (0.28, 0.32)} # (Delhi weight, India weight), synthetic
index_then = {"Food and beverages": 100.0, "Housing": 100.0, "Transport": 100.0, "Other": 100.0}
index_now = {"Delhi": {"Food and beverages": 103.0, "Housing": 104.5, "Transport": 102.0, "Other": 104.0},
"All India": {"Food and beverages": 106.0, "Housing": 103.5, "Transport": 102.5, "Other": 104.2}}
for state in ("Delhi", "All India"):
for g, (w_delhi, w_india) in groups.items():
rows.append({"state": state, "group": g,
"weight": w_delhi if state == "Delhi" else w_india,
"idx_then": index_then[g], "idx_now": index_now[state][g]})
df = pd.DataFrame(rows)
df["group_infl"] = df["idx_now"] / df["idx_then"] - 1
# Headline inflation as a weighted sum of group changes (weights sum to 1)
assert df.groupby("state")["weight"].sum().round(6).eq(1.0).all()
df["base_share"] = df["weight"] * df["idx_then"]
df["base_share"] /= df.groupby("state")["base_share"].transform("sum")
df["contribution"] = df["base_share"] * df["group_infl"]
headline = df.groupby("state")["contribution"].sum()
print("headline inflation, %:", (headline * 100).round(2).to_dict())
# Where does the gap come from? Contribution difference, in percentage points
pivot = df.pivot(index="group", columns="state", values="contribution") * 100
pivot["gap_pp"] = (pivot["Delhi"] - pivot["All India"]).round(2)
print(pivot.round(2))
print("sum of group gaps:", round(pivot["gap_pp"].sum(), 2),
"| headline gap:", round((headline["Delhi"] - headline["All India"]) * 100, 2))The key habit here is the reconciliation. The group contribution gaps must add up to the headline gap. If they do not, your weights, level filter or base period are wrong. With real CPI, the weights are fixed at the base year while prices move. So a group's effective share drifts over time. The formula above allows for that by weighting each group's price change by its weight times its starting index level.
Analysis plan
- 1Download Delhi and all-India, Combined and Urban, at group level, for every month available on the current base.
- 2Plot headline year-on-year inflation for Delhi Urban against India Urban. Mark months with imputed values.
- 3For the latest month and for a month a year earlier, decompose the gap into group contributions.
- 4Rank the groups by absolute contribution to the gap. Food often dominates Indian inflation, but check your own result rather than assuming it.
- 5Write three plain sentences on what the gap means for a Delhi household budget, with the caveat that CPI measures a fixed basket, not any single family's spending.
The deliverable
- Line chart: Delhi Urban vs India Urban headline inflation by month, with the base year stated in the subtitle.
- Waterfall chart: from India's headline to Delhi's, one bar per group contribution.
- Table: group, Delhi weight, India weight, Delhi group inflation, India group inflation, contribution gap in percentage points.
- README outline: source page and download date; base year and series; sector choice and why; level filtered; weights source; reconciliation check; limitations, including imputed values and the fixed-basket caveat.
Questions an interviewer will ask
- Why can't you compare index levels from two different base years?
- Why compare Delhi Urban with India Urban rather than Combined?
- Your group gaps add up to 0.3 points more than the headline gap. What went wrong?
- What does the Imputation column tell you, and how did you treat it?
- A retail client asks whether to raise prices in Delhi faster than elsewhere. What would you tell them from this, and what else would you want?
A companion project uses the same CPI series to compute a real policy rate from RBI data. Building decompositions that reconcile exactly is routine in our Data Analyst programme, which runs for 3–4 months live online, with optional in-person labs at our Noida centre.
Pankit Kumar has 10 years in Data Science & AI, building and shipping production systems in regulated pharma and clinical environments. He is a freelance trainer at Boston Institute of Analytics, AnalytixLabs and Scaler, and has taught this material to thousands of working professionals.
This article is part of our Data Analytics with Generative AI programme — 3–4 months. The full analyst stack — Excel, SQL, Power BI and Python pipelines — then a generative-AI layer you can prove is right.
Explore Data Analytics with Generative AI