Compare Census tract demographics and income in Python
Look up population, household income and poverty for Census tracts, with published margins of error and source statuses.
Add demographic context to Census tracts
A community planner has Census tract identifiers and wants to compare population, household income and poverty within a county. The ACS tract profile puts those measures and their published margins of error in one row per tract.
Download tract_profile.csv below. It is a genuine subset of the paid file: three tracts in Granville County, North Carolina, retaining all 62 columns. Their eleven-character identifiers appear in the tracts list in the Python code below. There are no invented customer records or simulated estimates.
The full $29 edition covers 85,382 tracts across the 50 states, DC and Puerto Rico. It includes 13 measures per tract, detailed source annotations and coverage reports in five CSV tables. Inspect the full 2020–2024 ACS download.
Code example
Save the CSV in your working directory. Run the following code in a notebook cell, IPython or a Python script. It uses Python’s standard library and keeps identifiers as text.
Paths are relative to your working folder; use from pathlib import Path; print(Path.cwd()) to check it, or supply full paths.
"""Compare genuine Granville County tract estimates; runs in a notebook or script."""
import csv
tracts = ['37077970101', '37077970102', '37077970200']
results = []
with open('tract_profile.csv', encoding='utf-8', newline='') as source:
for row in csv.DictReader(source):
if row['tract_geoid'] not in tracts:
continue
results.append({key: row[key] for key in (
'tract_geoid', 'population', 'population_moe_90',
'median_household_income', 'median_household_income_moe_90',
'median_household_income_status', 'median_household_income_moe_status',
'poverty_pct', 'poverty_pct_moe_90')})
if {row['tract_geoid'] for row in results} != set(tracts):
raise ValueError('One or more selected tracts are absent from this file.')
for row in results:
income = row['median_household_income'] or row['median_household_income_status']
income_moe = row['median_household_income_moe_90'] or row['median_household_income_moe_status']
print(f"{row['tract_geoid']} | population {row['population']} ± {row['population_moe_90']} | "
f"household income ${income} ± {income_moe} | "
f"poverty {row['poverty_pct']}% ± {row['poverty_pct_moe_90']} percentage points")
Analysis of the output
37077970101 | population 4400 ± 551 | household income $82624 ± 23956 | poverty 15.3% ± 8.6 percentage points
37077970102 | population 3623 ± 763 | household income $68444 ± 25199 | poverty 18.1% ± 11.5 percentage points
37077970200 | population 4408 ± 553 | household income $53848 ± 11934 | poverty 21.5% ± 8.7 percentage points
The first tract has an estimated 4,400 residents and a median household income of $82,624. The income figure describes households in that tract over the 2020–2024 period, expressed in 2024 dollars. The poverty estimate, 15.3%, uses people for whom poverty status is determined as its denominator.
The accompanying ± values are published 90% margins of error. For income, the first two tracts have estimates of $82,624 ± $23,956 and $68,444 ± $25,199. That uncertainty is substantial relative to their difference; the point estimates alone do not establish a reliable ranking. A formal comparison needs an appropriate uncertainty calculation. For poverty percentages, the margin is in percentage points, not a percentage of the estimate.
These fields can enrich a tract-level service-area table or a neighborhood dashboard. They describe an area, not the income or circumstances of an individual resident. The five-year period also means they should not be presented as today’s population or income.
Using the full dataset
Extract the purchased archive and replace the sample with the full tract_profile.csv; this example runs unchanged. Edit tracts for your own identifiers. For a larger input table, read its GEOIDs as text and join on tract_geoid, checking that its boundaries match the product’s 2024 geography.
The other measures include age, households, education, unemployment, housing units, tenure, gross rent and home value. Every estimate has separate estimate and MOE status fields. tract_measures.csv gives the measure’s unit, universe, Census variable IDs, original values and annotations. A blank estimate is not zero; the status explains whether it is unavailable or annotated, such as an open-ended median. Controlled MOEs have their own status and require the treatment described by Census.
county_coverage.csv summarizes tract coverage by county; measure_coverage.csv accounts for statuses by state and measure. source_accounting.csv documents the source responses, including the Puerto Rico social-profile selection.
The postal ZIP/tract crosswalk can identify related tracts, but its Q2 2026 address shares and this ACS edition have different dates and meanings. Check identifier compatibility and preserve unmatched records. Do not average tract medians with those address shares to claim a ZIP median. Use the county profile for published county estimates. The geography collection compares these options.
Sources and versions
The Census Bureau’s 2024 ACS five-year Data Profiles are the free original source. These estimates cover 2020–2024 and were released January 29, 2026. ACD retained the source responses and definitions on November 12, 2026 UTC. This product is a new ACD preparation of that existing Census edition.
Four profile groups supply the selected measures; Puerto Rico uses its applicable DP02PR social table. The product covers all 85,382 tracts in the national 2024 ACS tract inventory, including Connecticut’s current planning-region county structure. Guam and the US Virgin Islands are outside this ACS edition. No geographic boundaries are converted.
ACD supplies documented CSVs, preserved uncertainty and annotations, independent source checks and this tested example. The source and preparation record separates the source edition from processing changes. Improvements and documented source-error corrections to the purchased edition are included; later source editions may be sold separately.
Example checked November 12, 2026 against both these samples and the complete purchased files. Source and processing records, sample checksums · Expected result CSV. Independent preparation; no agency endorsement.