惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园 - 叶小钗
爱范儿
爱范儿
WordPress大学
WordPress大学
Last Week in AI
Last Week in AI
博客园 - 聂微东
雷峰网
雷峰网
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
博客园 - 三生石上(FineUI控件)
T
Tailwind CSS Blog
博客园 - Franky
酷 壳 – CoolShell
酷 壳 – CoolShell
博客园_首页
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
博客园 - 司徒正美
月光博客
月光博客
大猫的无限游戏
大猫的无限游戏
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
The Cloudflare Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
人人都是产品经理
人人都是产品经理
宝玉的分享
宝玉的分享
罗磊的独立博客
Jina AI
Jina AI

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
I cleaned India's Census 2011 data so you never have to
Ansuman Jaiswal · 2026-06-16 · via DEV Community
Cover image for I cleaned India's Census 2011 data so you never have to

Ansuman Jaiswal

Every Indian data scientist hits the same wall.

You need district-level population data. You go to censusindia.gov.in.
You find hundreds of inconsistent Excel files with merged headers,
footnote rows, and zero documentation.

You spend a full day just loading the data before doing any actual analysis.

I fixed that. Once. For everyone.

What I built

indiaset/census-2011
India's Census 2011 district data, clean, typed, and ready for pandas.
640 districts · 29 columns · 0 missing values
Validated against official India total · LGD codes attached

Load it in 4 lines

from huggingface_hub import hf_hub_download
import pandas as pd

path = hf_hub_download(
    repo_id="indiaset/census-2011",
    filename="census_2011_districts_final.parquet",
    repo_type="dataset"
)
df = pd.read_parquet(path)
print(df.shape)  # (640, 29)

What's in it

Column Description
state_code Census 2011 state code
state_name Official state/UT name
district_code Census 2011 district code
district_name District name as per Census
lgd_code LGD permanent district code
district_name_lgd District name as per LGD
pop_total Total population
pop_male Male population
pop_female Female population
pop_under6_total Children under 6 years
pop_sc Scheduled Caste population
pop_st Scheduled Tribe population
literate_total Literate persons
literate_male Literate males
literate_female Literate females
illiterate_total Illiterate persons
workers_total Total workers
workers_male Male workers
workers_female Female workers
non_workers_total Non workers
literacy_rate Literate / Total × 100
sex_ratio Females per 1000 males
workforce_participation Workers / Total × 100

The validation

The most important test - do all 640 district populations
sum to India's official total?

print(df['pop_total'].sum())
# 1210854977 ✅ — exact match, zero discrepancy

What the data actually shows

Most literate district → Pathanamthitta, Kerala : 88.74%

Least literate district → Alirajpur, Madhya Pradesh : 28.77%

Literacy gap across India : 60 points
Highest sex ratio → Mahe, Puducherry : 1176 per 1000 males

Lowest sex ratio → Leh, Jammu & Kashmir : 690 per 1000 males
National population → 1,210,854,977

Our district sum → 1,210,854,977

Difference → 0 ✅

Why LGD codes matter

Every district in this dataset carries an LGD code - the Government of India's permanent identifier for every administrative unit.

Without LGD codes, joining two Indian datasets is a nightmare:

# without LGD - name matching hell
df[df['district'] == 'Leh(Ladakh)']
# misses: "Leh Ladakh", "Leh", "LEH"

# with LGD - bulletproof
df[df['lgd_code'] == 9]
# always works, regardless of spelling

This dataset has LGD codes for all 640 districts,
including manual verification of Yanam and Mahe - two tiny Puducherry enclaves missing from the official LGD export.

Known limitations

⚠️ This data reflects 2011 boundaries.

  • Telangana does not exist here - carved out of Andhra Pradesh in 2014
  • New districts post-2011 are not present - India had 640 then, 800+ now
  • Population figures are from 2011 - use for structural comparisons, not current headcounts

The cleaning pipeline

The full reproducible pipeline is on GitHub.
Clone it, run the notebook, get the exact same parquet file.

git clone https://github.com/indiaset/census-2011-pipeline

Raw file → filter → clean → validate → LGD join → parquet.
Every step documented. Every decision explained.

What's next

This is dataset #1 under indiaset -
India's open data layer.

Dataset Status
Census 2011 districts ✅ Live
Indian Elections 1951–2024 🔜 Coming
RBI Economic Series 🔜 Coming
pip install indiaset 🔜 Coming

Citation

Jaiswal, Ansuman. (2026). India Census 2011 - District Level
[Dataset]. indiaset. Hugging Face.
https://huggingface.co/datasets/indiaset/census-2011

Licensed under CC-BY-4.0 - free to use, just credit the source.