Compare real income and spending growth across states in Python
Compare BEA real income and spending in California, North Dakota and North Carolina, separating total growth from growth per person.
A growing state economy does not necessarily mean the same growth per resident. This example compares real personal income and consumer spending in California, North Dakota and North Carolina from 2023 to 2024. It puts total real-income growth beside growth per person and adds BEA’s regional price deflator for context.
Sample data
state_real_income.csv below is a genuine subset of the paid main table: three states in 2023 and 2024, with all 20 fields unchanged. The optional input.csv contains the selected state FIPS codes and names. Those same selections appear in the places list in the Python code below. No observations or households are invented.
Save the sample as state_real_income.csv in your working folder. “Real” means adjusted for prices: BEA reports totals in millions of constant 2017 dollars and per-person amounts in constant 2017 dollars. Personal income includes earnings, property income and transfers; it is broader than wages and has not had personal current taxes subtracted.
Code example
The code selects each state’s 2023 and 2024 records, calculates percentage changes from their reported levels, and prints the result beside 2024 income per person. It runs in a notebook or as a Python script, using only the standard library.
Paths are relative to your working folder; use from pathlib import Path; print(Path.cwd()) to check it, or supply full paths.
import csv
from decimal import Decimal
# These are genuine state selections, also supplied in example_input.csv.
places = [
{"state_fips": "06", "state": "California"},
{"state_fips": "38", "state": "North Dakota"},
{"state_fips": "37", "state": "North Carolina"},
]
with open("state_real_income.csv", newline="", encoding="utf-8") as stream:
records = list(csv.DictReader(stream)) # Preserve identifiers as text.
lookup = {}
for row in records:
if row["geography_type"] == "state":
key = (row["state_fips"], row["year"])
if key in lookup:
raise ValueError(f"Duplicate state-year: {key}")
lookup[key] = row
def change(new, old):
return (Decimal(new) / Decimal(old) - 1) * 100
results = []
for place in places:
old = lookup[(place["state_fips"], "2023")]
new = lookup[(place["state_fips"], "2024")]
result = {
"state_fips": place["state_fips"],
"state": place["state"],
"real_income_per_person_2024": new["real_personal_income_per_capita"],
"real_income_total_change_pct": f"{change(new['real_personal_income_millions'], old['real_personal_income_millions']):.1f}",
"real_income_per_person_change_pct": f"{change(new['real_personal_income_per_capita'], old['real_personal_income_per_capita']):.1f}",
"real_spending_per_person_change_pct": f"{change(new['real_pce_per_capita'], old['real_pce_per_capita']):.1f}",
"regional_deflator_change_pct": f"{change(new['implicit_regional_price_deflator'], old['implicit_regional_price_deflator']):.1f}",
}
results.append(result)
print("2023–2024 changes; income levels are constant 2017 dollars per person.")
print("State | Real income/person 2024 | Income total | Income/person | Spending/person | Deflator")
for row in results:
print(f"{row['state']} | ${int(row['real_income_per_person_2024']):,} | "
f"{row['real_income_total_change_pct']}% | {row['real_income_per_person_change_pct']}% | "
f"{row['real_spending_per_person_change_pct']}% | {row['regional_deflator_change_pct']}%")
Analysis of the output
2023–2024 changes; income levels are constant 2017 dollars per person.
State | Real income/person 2024 | Income total | Income/person | Spending/person | Deflator
California | $63,028 | 5.5% | 4.9% | 3.7% | 1.3%
North Dakota | $65,271 | -2.2% | -3.1% | 0.1% | 3.5%
North Carolina | $56,310 | 4.4% | 2.9% | 1.9% | 2.5%
California’s real income rises 5.5% in total and 4.9% per person. North Carolina’s grows 4.4% in total and 2.9% per person. Population growth makes the per-person comparison less favorable than the total in both cases. For a market brief, the total describes the scale of resident income, while the per-person figure helps separate that scale from the number of residents.
North Dakota illustrates a different outcome: real income falls 2.2% in total and 3.1% per person, while real spending per person rises 0.1%. It still has the highest real-income-per-person level among these three states in 2024, at $65,271. A high level and a decline over one year can coexist.
The deflator column shows changes in BEA’s implicit regional price deflator (IRPD), which combines geographic price differences with the national PCE price index. North Dakota’s deflator rises 3.5%, compared with 1.3% in California. The income and spending columns are already adjusted for prices; do not deflate them again. These comparisons describe aggregate changes, not their causes or the experience of a typical household.
Using the full dataset
After purchase, replace the sample with state_real_income.csv from the archive. Change the text state codes in places or select other years. To load your own list, replace the inline list with a csv.DictReader reading your state-selection CSV. areas.csv and measures.csv document valid keys and original definitions.
For state comparisons, select geography_type=state and join on text state_fips + year. The full unique key is geography_type + bea_area_code + year. The United States is a separate benchmark with blank state FIPS; do not add it to states or assume real state totals sum exactly to that benchmark.
Interpreting prices and growth
The file includes all-items regional price parity (RPP), a within-year geographic price-level comparison with the national level set to 100. The IRPD combines RPP with the national PCE price index. Its national 2017 value is 100, but state 2017 values can differ from 100. An annual change in RPP alone is not a local inflation rate.
Annual changes are our calculations from BEA’s published rounded levels, stored to six decimal places. They may differ from BEA’s growth rates computed with unrounded inputs. For 2008, changes are blank with growth_status=no_preceding_year_in_edition; blank does not mean zero growth.
Per-person income is an average across all residents, not median household income or take-home pay. PCE includes imputed and third-party spending. The gap between income and spending is not an official saving rate. The tables do not supply household distributions or standard errors.
Choosing companion data
State Personal & Disposable Income History provides nominal income, taxes and income components; State Consumer Spending by Category provides nominal spending categories. Both use a newer September 2026 source revision. Mixing their nominal values with this February 2026 price vintage need not reproduce the official real series in this product.
The Regional Price Parity Reference adds detailed price components and metro coverage. State all-items RPP is already included here. See the spending, income and price collection for these separately purchased companions.
Sources and versions
Source: BEA’s February 19, 2026 release, tables SARPI, SAIRPD and SARPP, covering 2008–2024. We retained the source and methodology on November 19, 2026 UTC. This is one revised historical edition, not a collection of original annual publication vintages.
BEA schedules its next release for December 10, 2026. This purchase covers the current edition. Our processing improvements and publisher error corrections to that edition are included; future source publications may be separate purchases. BEA supplies the original tables free; Actually Clean Data sells preparation, checks and documentation. Read the release notes.
Example checked November 19, 2026 against both these samples and the complete purchased files. Source and processing records, sample checksums · Expected result CSV. Independent preparation; no agency endorsement.