Compare state manufacturing GDP and industry shares in Python

Compare manufacturing shares and real output growth in North Carolina, Georgia and Virginia with genuine BEA annual data.

When comparing state economies, an industry's share and its growth answer different questions. This example compares manufacturing in North Carolina, Georgia and Virginia in 2019 and 2025. It uses current-dollar GDP to measure manufacturing's share of each economy, and real GDP to compare output growth after adjusting for prices.

Sample data

state_industry_gdp.csv below is a genuine subset of the paid main table: manufacturing in three states and two years, with all 23 fields unchanged. The optional input.csv lists the selected state FIPS codes and names; the same selections appear in the places list in the Python code below.

Save the sample as state_industry_gdp.csv in your working folder. BEA industry code 12 identifies manufacturing in this table; its NAICS grouping is 31-33. BEA line codes and NAICS codes are different identifiers.

Code example

The code prints manufacturing's share in each year and its cumulative real growth between those years. It runs in a notebook or as a Python script using the standard library. The supplied share already uses each state's reported all-industry total, so the example does not need to reconstruct that denominator.

Paths are relative to your working folder; use from pathlib import Path; print(Path.cwd()) to check it, or supply full paths.

Python 3.10+ · Jupyter, IPython or a script
"""Compare manufacturing's economic share and real growth. Runs in a notebook."""
import csv
from decimal import Decimal
from pathlib import Path

# These states are selection inputs, also provided in input.csv.
places = [
    {'state_fips': '37', 'state': 'North Carolina'},
    {'state_fips': '13', 'state': 'Georgia'},
    {'state_fips': '51', 'state': 'Virginia'},
]
data_path = Path('state_industry_gdp.csv')
selected = {p['state_fips'] for p in places}
with data_path.open(newline='', encoding='utf-8') as source:
    rows = {
        (r['state_fips'], r['year']): r
        for r in csv.DictReader(source)
        if r['geography_type'] == 'state'
        and r['state_fips'] in selected
        and r['industry_code'] == '12'  # BEA manufacturing, NAICS 31–33
        and r['year'] in {'2019', '2025'}
    }
results = []
print('Manufacturing: share of state GDP and real output growth')
print(f'{"State":<16} {"2019 share":>12} {"2025 share":>12} {"Real growth 2019–25":>22}')
for place in places:
    before = rows[place['state_fips'], '2019']
    after = rows[place['state_fips'], '2025']
    if any(r['real_status'] != 'reported' or r['share_status'] != 'calculated_from_published_levels' for r in [before, after]):
        raise ValueError('This comparison needs reported GDP values.')
    real_growth = (Decimal(after['real_gdp_millions']) / Decimal(before['real_gdp_millions']) - 1) * 100
    result = dict(state_fips=place['state_fips'], state=place['state'],
                  share_2019=before['nominal_share_of_area_gdp_pct'],
                  share_2025=after['nominal_share_of_area_gdp_pct'],
                  real_growth_2019_2025=f'{real_growth:.1f}')
    results.append(result)
    print(f'{place["state"]:<16} {Decimal(result["share_2019"]):>11.1f}% {Decimal(result["share_2025"]):>11.1f}% {real_growth:>21.1f}%')

Analysis of the output

Manufacturing: share of state GDP and real output growth
State              2019 share   2025 share    Real growth 2019–25
North Carolina          15.0%        12.4%                   3.0%
Georgia                  9.5%         9.4%                  17.4%
Virginia                 7.9%         7.3%                  10.2%

North Carolina's manufacturing share falls from 15.0% to 12.4%, while its real manufacturing GDP rises 3.0%. A smaller share of a growing economy does not necessarily mean less output. The share measures manufacturing's current-dollar weight in the state economy; real growth measures the change in its price-adjusted output.

Georgia's manufacturing share is nearly unchanged, at 9.5% and 9.4%, while real manufacturing GDP grows 17.4%. Virginia's share falls from 7.9% to 7.3%, with real growth of 10.2%. These are cumulative changes over six years, not annual growth rates. A regional business brief could use the two measures together to distinguish industrial concentration from growth.

The figures describe value added, not company revenue, jobs, profitability or the causes of these changes. A falling nominal share can reflect relative prices as well as differences in real growth. These three states are an illustrative comparison, not a ranking of all states.

Using the full dataset

After purchase, replace the sample with state_industry_gdp.csv from the archive. Change places, the years or the industry code. areas.csv lists geography keys; industries.csv supplies definitions, NAICS groupings and parent relationships for all 92 industry/group codes. To use your own selections, load a state CSV with csv.DictReader in place of the inline list.

The full unique key is bea_area_code + industry_code + year. For state comparisons, filter geography_type=state and preserve state_fips as text. Regions and the national reference overlap the states and have blank state FIPS.

Industry shares and aggregation

Parent industries, their children and supplementary broad groups overlap. Do not sum all rows. The nonoverlapping_partition=1 flag selects 15 broad groups, including government, for a current-dollar composition chart. Manufacturing and its durable/nondurable components must not appear in the same sum.

Real GDP uses chained 2017 dollars. Those industry amounts generally cannot be added, even when the industries do not overlap. Use the reported all-industry total, compare the same industry's growth across years, and use nominal GDP for shares. This dataset does not supply official contributions to aggregate real GDP growth.

Threshold values and source definitions

Original numeric zero stays zero. BEA's (L) means less than $50,000 and becomes a blank numeric field with a threshold status. Calculated growth is blank when a required source amount is unavailable or the preceding value is zero; the first year is also explicitly unavailable. Shares and growth use rounded published values and may differ slightly from calculations with BEA's unrounded data.

The industry groupings follow 2017 NAICS. For other transportation equipment manufacturing, the source CSV contains a range typo. The product preserves that source value and separately supplies the range shown in BEA's classification workbook, with an explanation. It does not silently convert the data to 2022 NAICS.

Adding employment context

The State Industry Employment, Hours & Earnings History adds payroll jobs, hours and pay. Its manufacturing jobs and output guide uses these same states and years, with free samples from both products. State/year keys match directly; the manufacturing industry match is explicitly reviewed because BLS CES codes and BEA line codes are different.

Adding income and spending context

State Personal & Disposable Income History and State Consumer Spending by Category use the same September 2026 publication date. Select the desired measure/category before joining on state and year. The join repeats state totals across industry rows; never sum those repeated totals. GDP describes production within a state, while personal income and PCE describe residents.

County GDP & Personal Income History provides county-level totals, with a different source vintage and no industry breakdown. The manufacturing collection connects this annual state view with separately purchased national production, price and labor products.

Sources and versions

Source: U.S. Bureau of Economic Analysis, annual GDP by state, tables SAGDP2 and SAGDP9. The September 30, 2026 publication covers 1997–2025; we retained the source on November 20, 2026 UTC. This is one revised edition, not the values as originally published each year.

BEA provides the original data free. The purchase covers preparation, documentation and validation of this fixed edition. Processing improvements and publisher error corrections to this purchased edition are included; future source editions may be sold separately. Read the release notes.

Example checked November 20, 2026 against both these samples and the complete purchased files. Source and processing records, sample checksums · Expected result CSV. Independent preparation; no agency endorsement.