Compare industry productivity and labor costs in Python

Compare published output, hours, productivity and labor-cost growth for food manufacturing, wood products and chemicals.

Compare productivity and labor costs across industries

A business analyst comparing manufacturing industries needs more than an hourly wage series. Output per hour and labor cost per unit of output describe how production and compensation have changed together. This example compares food manufacturing, wood products and chemicals in 2025, using the annual percentage changes published by BLS.

The optional input.csv contains three genuine BLS industry choices. The same choices appear in the selections list in the Python code below. These are selected industries; no observations have been invented.

Download annual_observations.csv into your working folder. It is a genuine subset of the paid table: all 156 observations for these industries during 2024–2025, including every selected measure and both statistic types, with all 30 fields unchanged. The full $29 edition contains 201,763 observations across 203 industry definitions, plus series definitions, units, footnotes and coverage. Inspect the full product.

Code example

This standard-library code runs in a notebook cell, IPython or a script. It selects duration_code == '1' to use the published annual percentage changes. The index and level observations in the same file have a different duration code and are not part of this comparison.

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 published productivity, output, hours and labor-cost growth."""
import csv

# Real BLS industry choices; the same selections are provided in input.csv.
selections = [
    {'industry_code': 'N311___'},  # Food manufacturing
    {'industry_code': 'N321___'},  # Wood products
    {'industry_code': 'N325___'},  # Chemicals
]
year = '2025'
measures = {'L00': 'productivity_pct', 'T01': 'output_pct',
            'L01': 'hours_pct', 'U12': 'hourly_compensation_pct',
            'U10': 'unit_labor_cost_pct'}
wanted = {row['industry_code'] for row in selections}
lookup = {}
with open('annual_observations.csv', newline='', encoding='utf-8') as source:
    for row in csv.DictReader(source):
        if (row['industry_code'] in wanted and row['year'] == year
                and row['duration_code'] == '1' and row['measure_code'] in measures):
            if row['unit'] != 'percent_change' or row['availability'] != 'reported':
                raise ValueError('Inspect the source measure or availability')
            key = (row['industry_code'], row['measure_code'])
            if key in lookup:
                raise ValueError(f'Duplicate industry/measure: {key}')
            lookup[key] = row

results = []
for selection in selections:
    code = selection['industry_code']
    if any((code, measure) not in lookup for measure in measures):
        raise ValueError(f'Comparison year is incomplete for {code}')
    result = {'industry_code': code, 'industry': lookup[code, 'L00']['industry_name']}
    result.update({label: lookup[code, measure]['value'] for measure, label in measures.items()})
    results.append(result)
    print(f"{result['industry']} | productivity {result['productivity_pct']}% | "
          f"output {result['output_pct']}% | hours {result['hours_pct']}% | "
          f"hourly compensation {result['hourly_compensation_pct']}% | "
          f"unit labor cost {result['unit_labor_cost_pct']}%")

Analysis of the output

Food manufacturing | productivity -2.1% | output -1.8% | hours 0.3% | hourly compensation 3.4% | unit labor cost 5.6%
Wood product manufacturing | productivity 1.2% | output 0.2% | hours -1.0% | hourly compensation 1.5% | unit labor cost 0.3%
Chemical manufacturing | productivity -1.9% | output 0.3% | hours 2.2% | hourly compensation 1.9% | unit labor cost 3.9%

In food manufacturing, output fell 1.8% while hours increased 0.3%. Output per hour therefore declined, with BLS reporting a 2.1% productivity decrease. Hourly compensation rose 3.4%, and unit labor costs rose 5.6%. That is a useful distinction: the cost of labor per unit of output increased faster than compensation per hour.

Wood products had a different pattern. Output rose 0.2% and hours fell 1.0%, producing a 1.2% productivity increase. Hourly compensation rose 1.5%, while unit labor costs rose just 0.3%. Chemicals had modest output growth of 0.3%, but hours grew faster at 2.2%; productivity fell 1.9% and unit labor costs rose 3.9%.

These are industry trends, not measurements of an individual worker’s effort or a particular company’s profit. Technology, capital, purchased inputs and changes in production can all affect productivity. The relationship between percentage changes is multiplicative, and the displayed source rates are rounded; subtracting productivity growth from compensation growth is only an approximation.

Use each measure for the question it answers

Employer compensation costs supplies dollars per hour and benefit shares. Industry employment history supplies monthly jobs, hours and earnings. Industry PPI describes prices received by producers. This productivity edition adds annual output per hour and labor costs per unit of output. Review industry definitions and coverage before aligning these independently purchased references; they are not an automatic crosswalk.

Explore related business and labor datasets →

Using the full dataset

Extract the purchased ZIP and replace the sample with its complete annual_observations.csv. The example runs unchanged. Keep identifiers as text, including underscores in the BLS industry code. The unique key is series_id + year + period. Select the industry, measure and statistic deliberately before comparing values.

duration_code = 0 identifies an index or level, while duration_code = 1 identifies an annual percentage change. Read unit and series_title alongside measure_name: the original measure name can describe its index or level even on a percentage-change row. The measures.csv dictionary makes each combination explicit.

The selected indexes use 2017=100. An index of 120 means a 20% increase from that series’ base; it does not mean $120 or establish which industry has higher absolute productivity. Level measures distinguish millions of current dollars, millions of hours and thousands of jobs. Industry levels overlap and cannot all be summed. Sectoral output excludes transactions within an industry and is different from value added.

series.csv records each history’s actual endpoints. The coverage.csv table distinguishes years before a series starts, years after it ends and any interior absence. Some histories end in 2023 or 2024. BLS flag A specifically identifies series whose 2025 values are unavailable because of source-data changes; an unflagged earlier endpoint does not establish the same reason.

Sources and versions

Source: BLS Industry Productivity bulk files, captured November 7, 2026 UTC, with bulk data last modified September 24. This is one retained snapshot of history as revised through that capture, not a collection of original yearly vintages. Observation coverage is 1987–2025 where available; annual-change series begin in 1988.

The BLS technical note explains the productivity and unit-cost measures. BLS’s 2025 manufacturing and mining release also explains that manufacturing output for 2024–2025 is estimated using historical relationships with output, price indexes and Federal Reserve industrial production. Other sectors, state measures and total-factor productivity are outside this edition.

BLS provides the source data free. ACD sells preparation, validation, documentation and delivery. Processing improvements and publisher error corrections to this purchased edition are included; new source publications may be sold separately. Read the source and 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.