Compare producer price changes by industry in Python

Compare December-to-December industry price changes for food manufacturing, wood products and long-distance freight using original BLS PPI series.

Compare price changes across three industries

An industry’s Producer Price Index measures how prices received by producers change over time. This example compares December 2024 with December 2025 for food manufacturing, wood products and long-distance truckload freight. It uses the change within each original series, so the comparison does not confuse different index bases with different dollar prices.

The optional input.csv contains three genuine BLS series selections. The same choices appear in the selections list in the Python code below. These are selected industries, not invented observations.

Download monthly_observations.csv into your working folder. It is a genuine subset of the paid table: all 72 monthly observations for these three series during 2024–2025, with all 29 fields unchanged. The full $29 edition includes 315,117 monthly observations across 1,456 original industry-total series, separate annual averages, definitions and source coverage. Inspect the full coverage and fields.

Code example

This standard-library code runs in a notebook cell, IPython or a script. Change start, end and the series choices to investigate other available months. The code checks that each requested observation is unique and reported before calculating a percentage change.

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 December-to-December producer price changes for three industries."""
import csv
from decimal import Decimal

# These are real BLS series selected for the analysis, not invented observations.
selections = [
    {'series_id': 'PCU311---311---'},
    {'series_id': 'PCU321---321---'},
    {'series_id': 'PCU484121484121'},
]
start, end = '2024-12', '2025-12'
wanted = {r['series_id'] for r in selections}
lookup = {}
with open('monthly_observations.csv', newline='', encoding='utf-8') as source:
    for row in csv.DictReader(source):
        if row['series_id'] in wanted and row['month'] in (start, end):
            key = (row['series_id'], row['month'])
            if key in lookup:
                raise ValueError(f'Duplicate observation: {key}')
            lookup[key] = row
results = []
for selection in selections:
    sid = selection['series_id']
    before, after = lookup.get((sid, start)), lookup.get((sid, end))
    if before is None or after is None:
        raise ValueError(f'One comparison month is absent for {sid}')
    if any(r['availability'] != 'reported' for r in (before, after)):
        raise ValueError(f'Inspect source availability for {sid}')
    change = (Decimal(after['value']) / Decimal(before['value']) - 1) * 100
    result = {'series_id': sid, 'industry': after['industry_name'],
              'start_index': before['value'], 'end_index': after['value'],
              'change_pct': f'{change:.2f}'}
    results.append(result)
    print(f"{result['industry']} | {start}: {result['start_index']} | "
          f"{end}: {result['end_index']} | change: {result['change_pct']}%")

Analysis of the output

Food mfg | 2024-12: 262.049 | 2025-12: 267.564 | change: 2.10%
Wood product manufacturing | 2024-12: 183.883 | 2025-12: 179.908 | change: -2.16%
General freight trucking, long-distance TL | 2024-12: 171.718 | 2025-12: 181.077 | change: 5.45%

Food manufacturing’s index rose from 262.049 to 267.564, a 2.10% increase. Wood products fell 2.16%, while long-distance truckload freight rose 5.45%. These figures describe the change in prices received for each industry’s output over the selected year.

The different index levels are not directly comparable price tags. Food manufacturing’s retained base is December 1984; the other two series use December 2003. Each base is set to 100. An index of 267.564 does not mean a price of $267.56 or establish that food is more expensive than freight.

These are unadjusted industry averages, not changes for a particular company or transaction. They do not establish a change in revenue, production volume or profit. Industry PPI covers net output; it is not a general measure of the inputs an industry buys. Wholesale and retail PPI series measure margins.

Choose the price measure for the task

Use CPI history for consumer purchasing prices, ECI history for employer compensation-cost growth, and this PPI edition for prices received by producers. Industry employment history can supply context, but review industry definitions and adjustment status before aligning series. The products are independently purchased references, not an automatic crosswalk.

Compare related business and labor datasets →

Using the full dataset

Extract the purchased ZIP and replace the sample with its complete monthly_observations.csv. This example runs unchanged. Keep identifiers as text, including dashes in industry and product codes. The unique key is series_id + year + period.

series.csv gives each original title, index base, source start/end dates and delivered coverage. industries.csv supplies original labels. The current PC and discontinued ND directories contribute 975 and 481 series respectively. Their original identities remain separate; discontinued series are not spliced to guessed successors or converted to current NAICS.

The prepared month_change_pct and year_change_pct fields compare the same series with the exact previous calendar month and the same month one year earlier. They use Decimal arithmetic, rounded to six decimal places. When the required prior observation is absent from this edition, the comparison stays blank and its status explains that absence. Gaps are not zeros.

annual_observations.csv contains the 26,078 annual averages supplied by BLS as M13 records, separate from monthly observations. coverage.csv records reported and absent months for each series/year. footnotes.csv preserves the source correction flag. source_accounting.csv accounts for included and excluded rows, and observation_sources.csv identifies every contributing source-file row, including identical appearances in overlapping files.

Sources and versions

Source: BLS current industry PPI and discontinued industry PPI files, captured November 7, 2026 UTC. The bulk data were last modified October 15. Observation coverage is January 2004–December 2025 where available: NAICS-based industry publication began in 2004, and 2025 was the last complete calendar year at capture.

The download contains history as revised in that retained source snapshot, not the original monthly release vintages or a live feed. Detailed product series, special letter-coded combinations, construction input aggregates, commodity-organized PPI and partial 2026 history are outside this edition. Read the PPI overview and data retrieval guide for source scope and classifications.

The one-time purchase includes processing improvements and documented publisher error corrections to this edition. New periods or genuinely new source editions may be sold separately; routine revisions are not automatically errata. BLS provides the source data free. ACD sells preparation, validation, documentation and delivery. Read the preparation record.

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