Compare county nonemployer businesses and receipts in Python

Look up consulting businesses in three counties and compare reported receipts, with units and noise flags kept explicit.

Compare consulting businesses across counties

You are preparing a local market profile and want to include businesses that have no paid employees. Employer payroll data leaves these businesses out. This example uses Census Nonemployer Statistics to compare management, scientific and technical consulting businesses, industry 5416, in three counties.

The optional input.csv selects Wake and Durham counties in North Carolina and San Francisco County in California. The same real county FIPS and industry codes appear in the markets list in the Python code below. No business counts or receipts are invented.

Download county_industries.csv into your working folder. It is a genuine subset of the paid reference: the three complete county/industry records for this example, with all 21 fields retained. The full $29 product contains 706,349 county/industry records covering 3,143 published counties and county equivalents, plus separate benchmarks, labels and source accounting. Inspect the full coverage and fields.

Code example

This code uses Python’s standard library and runs in a notebook cell, IPython or a script. It matches both county FIPS and industry code, converts receipts from thousands of dollars to dollars, and calculates receipts per business.

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
import csv
from decimal import Decimal

# These real county/industry selections also appear in example_input.csv.
markets = [
    {'county_fips': '37183', 'naics_code': '5416'},
    {'county_fips': '37063', 'naics_code': '5416'},
    {'county_fips': '06075', 'naics_code': '5416'},
]
wanted = {(m['county_fips'], m['naics_code']) for m in markets}
reference = {}
with open('county_industries.csv', newline='', encoding='utf-8-sig') as source:
    for row in csv.DictReader(source):
        key = (row['county_fips'], row['naics_code'])
        if key in wanted:
            if key in reference:
                raise ValueError(f'Duplicate county/industry key: {key}')
            reference[key] = row

results = []
for market in markets:
    row = reference.get((market['county_fips'], market['naics_code']))
    result = dict(market, county='', establishments='', receipts_usd='',
                  receipts_per_business_usd='', noise_flag='', status='outside_reference')
    if row:
        result.update(county=row['geography_name'], establishments=row['establishments'],
                      noise_flag=row['receipts_noise_flag'], status='reported')
        if row['establishments_flag'] or row['receipts_flag']:
            result['status'] = 'suppressed'
        else:
            receipts = Decimal(row['receipts_thousands_usd']) * 1000
            businesses = Decimal(row['establishments'])
            result['receipts_usd'] = f'{receipts:.0f}'
            if businesses > 0:
                result['receipts_per_business_usd'] = f'{receipts / businesses:.0f}'
    results.append(result)

print('2024 nonemployer businesses: management, scientific and technical consulting (5416)')
for row in results:
    if row['status'] == 'reported':
        print(f"{row['county']}: {int(row['establishments']):,} businesses; "
              f"${int(row['receipts_usd']):,} receipts; "
              f"${int(row['receipts_per_business_usd']):,} per business; noise {row['noise_flag']}")
    else:
        print(f"{row['county_fips']} / {row['naics_code']}: {row['status']}")

Replace markets with your own county/industry selections, or load those two columns from your CSV. Keep identifiers as strings, including San Francisco’s leading zero in 06075. Selections beyond the three example records require the complete purchased table.

Analysis of the output

2024 nonemployer businesses: management, scientific and technical consulting (5416)
Wake County, North Carolina: 7,060 businesses; $413,148,000 receipts; $58,520 per business; noise G
Durham County, North Carolina: 2,197 businesses; $86,645,000 receipts; $39,438 per business; noise G
San Francisco County, California: 7,352 businesses; $535,487,000 receipts; $72,836 per business; noise G

Wake County reports 7,060 nonemployer consulting businesses and $413,148,000 in receipts for 2024. Durham reports 2,197 businesses and $86,645,000; San Francisco reports 7,352 and $535,487,000. The prepared reference supplies the names, business counts, receipts and source flags for each county/industry selection.

Receipts per business provides scale alongside the totals: approximately $58,520 in Wake, $39,438 in Durham and $72,836 in San Francisco. This is total reported revenue divided by the number of businesses, rounded to dollars. It is not median revenue, profit or the income of a typical owner. Businesses can have different numbers of owners and different operating expenses.

All three records carry noise flag G, meaning the source’s receipts perturbation is below 2%. Flags H and J mean 2% to under 5% and 5% or more. These are disclosure-protection categories, not statistical confidence intervals.

A record with S has a withheld estimate that does not meet publication standards. The example labels it suppressed and leaves the calculated amounts empty. A key absent from the supplied reference is labeled outside_reference. Neither result establishes zero business activity.

Add context from employer-business data

County Business Patterns describes employer establishments, while this product describes businesses without paid employees. They can support separate sections of a local industry profile. Our current CBP product covers 2023 with 2017 NAICS; this product covers 2024 with 2022 NAICS. Those differences prevent a simple same-year total or employer/nonemployer share.

The 2017–2022 NAICS crosswalk helps inspect classification relationships, but a split or merge does not provide weights for allocating counts. Check geography, industry coverage and year as well. Compare the business and labor-market products.

Using the full dataset

Extract the purchased ZIP and replace the sample with the complete county_industries.csv. The code runs unchanged and scans the file without loading every row into memory. County FIPS and NAICS code uniquely identify each observation in this 2024 edition.

industries.csv provides all 452 published industry codes, labels and hierarchy fields. These include all-sector total 00 and combined sectors such as 31-33. Select the level appropriate to your question: parent and child industries overlap, so summing every row would double count activity.

benchmarks.csv contains separate state and national observations. geographies.csv supplies the names and identifiers, while coverage.csv and source_row_status.csv document the source selection. The latter has 1,161,184 records and exceeds common spreadsheet row limits; use Python or a database for it. Dictionaries document all delivered fields.

Sources and versions

Source: U.S. Census Bureau Nonemployer Statistics, 2024, released September 29, 2026 and retained by ACD October 27, 2026 UTC. The observations cover calendar 2024 and use 2022 NAICS. Those dates are separate from ACD’s processing revision.

The Census methodology defines businesses with no paid employees, subject to federal income tax and the source’s receipts thresholds and industry exclusions. Location generally follows business mailing address rather than necessarily the operating location. The file is not a directory of individual firms, owners or workers.

The preparation record explains source coverage and validation. This is one fixed source edition. Same-source processing improvements are included for purchasers; genuinely new source editions may be sold separately. No automatic refresh is promised. Census supplies the original data free; ACD sells preparation, documentation, validation and delivery.

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