Compare college program earnings and borrowing in Python

Join three college program selections to published earnings and federal borrowing, with clear cohorts and suppression statuses.

Compare earnings and borrowing for a college program

You are researching bachelor's programs in business administration and management at Appalachian State, Bennett College and NC State. College Scorecard groups these programs under four-digit CIP 5202 and credential level 3. This example adds reported earnings four years after completion and cumulative student federal borrowing to that shortlist.

The optional input.csv contains those three genuine college, program and credential selections. The same inputs appear in the selections list in the Python code below. All outcome values come from the product; none are invented.

institution_programs.csv is the small product subset that connects those campuses to their reporting groups. program_outcomes.csv contains their corresponding outcomes, with every prepared column retained. Save both files in your working folder. The full $29 reference contains 213,613 program outcome groups, all 223,587 campus/program relationships, directory context and documented source cohorts.

Code example

The code uses Python's standard library and runs in a notebook, IPython or a script. It filters the campus table by your selections, then joins outcomes on the complete opeid6, cip4_code and credential_level key. Availability statuses control how values are printed.

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 pathlib import Path

# Use the folder containing the two sample CSVs, or your extracted purchase.
folder = Path('.')
# Same genuine college selections as example_input.csv; replace with your own.
selections = [
    {'unitid': '197869', 'cip4_code': '5202', 'credential_level': '3'},
    {'unitid': '197993', 'cip4_code': '5202', 'credential_level': '3'},
    {'unitid': '199193', 'cip4_code': '5202', 'credential_level': '3'},
]
keys = ('opeid6', 'cip4_code', 'credential_level')
wanted = {(r['unitid'], r['cip4_code'], r['credential_level']) for r in selections}
with (folder / 'institution_programs.csv').open(newline='', encoding='utf-8') as f:
    programs = [r for r in csv.DictReader(f)
                if (r['unitid'], r['cip4_code'], r['credential_level']) in wanted]
if len(programs) != len(wanted):
    raise ValueError('A selected college/program is absent; check codes and source coverage.')
needed = {tuple(r[k] for k in keys) for r in programs}
with (folder / 'program_outcomes.csv').open(newline='', encoding='utf-8') as f:
    outcomes = {tuple(r[k] for k in keys): r for r in csv.DictReader(f)
                if tuple(r[k] for k in keys) in needed}

def dollars(row, field):
    if row[field + '_status'] != 'reported':
        return row[field + '_status'].replace('_', ' ')
    return f"${float(row[field]):,.0f}"

results = []
for program in programs:
    outcome = outcomes[tuple(program[k] for k in keys)]
    result = {
        'institution': program['institution_name'],
        'earnings_4yr': dollars(outcome, 'earnings_4yr_median'),
        'student_debt': dollars(outcome, 'student_debt_any_institution_median'),
    }
    results.append(result)
    print(f"{result['institution']}: earnings {result['earnings_4yr']}; debt {result['student_debt']}")
print('Earnings: 2017–18 / 2018–19 completers, measured 2022–2023 in 2024 dollars.')
print('Debt: different completers, 2022–23 / 2023–24; nominal cumulative federal borrowing.')

Set folder to the directory containing the two CSVs. Replace selections with your own college/program list, or read those three columns from your CSV. Keep all codes as text, including leading zeros.

Analysis of the output

Appalachian State University: earnings $64,932; debt $16,250
Bennett College: earnings privacy suppressed; debt privacy suppressed
North Carolina State University at Raleigh: earnings $84,349; debt $19,000
Earnings: 2017–18 / 2018–19 completers, measured 2022–2023 in 2024 dollars.
Debt: different completers, 2022–23 / 2023–24; nominal cumulative federal borrowing.

For the selected business program, Appalachian State has reported median earnings of $64,932 and NC State has $84,349. These earnings describe federally aided completers who worked and were not enrolled during the measurement year. They can inform a program comparison, but they do not measure the earnings of every graduate or establish what attending a particular institution caused.

The student-debt figures are cumulative Stafford/Direct and Graduate PLUS borrowing at any institution attended. They exclude Parent PLUS, which has separate fields in the full table. They are not current balances, private borrowing or total tuition costs. Bennett's selected values are privacy-suppressed, so the output retains that explanation instead of substituting zero.

Keep the cohorts alongside the comparison

The four-year earnings figure pools completers from 2017–18 and 2018–19, measures their earnings in 2022 and 2023, and expresses the result in 2024 dollars. Debt describes different completers, from 2022–23 and 2023–24, in nominal disbursement amounts. Dividing one by the other would not describe one cohort's return on its borrowing.

The full reference also provides one-, five- and seven-year earnings. Those horizons use different completion cohorts; they are not successive observations of the same class. metric_definitions.csv supplies the exact source cohort text, units and population for each selected measure.

Using the full dataset

Extract the purchased ZIP and point folder to its CSVs. The example runs unchanged. To research another field, use the campus table to find its four-digit CIP and Scorecard credential code, then retain all three outcome join keys.

Scorecard sometimes reports the same outcome group for several branch campuses. The reference stores each equality-checked group once and preserves every source campus relationship separately. A campus join may repeat a group in your result; do not sum its counts or medians again for each branch.

Six tables include outcomes, campus relationships, directory context, measure/cohort definitions, source-row accounting and field coverage. Numeric 0 remains a reported value; original PS and NA have separate statuses. The source suppresses many program measures. The product retains those groups without claiming that each has published earnings.

Optional directory joins retain 5,573 program rows without a UNITID and 2,386 without a current directory match. Location refers to a reporting campus, not where its graduates live or work. National benchmarks, subgroup measures, repayment and legacy horizons are outside this prepared selection.

For counts of awards by detailed program, see the separate IPEDS completions reference. It uses six-digit CIP detail and different award codes; its all-student awards are a different population from Scorecard's aided graduates. The education and careers collection explains how these products complement each other.

Sources and versions

This is the October 15, 2026 College Scorecard release, retained November 1, 2026 UTC. The release date, graduating cohorts, earnings measurement years and dollar basis are distinct. The source is the U.S. Department of Education College Scorecard, with its dictionary and cohort map and field-of-study documentation.

The October 2026 graduate-student erratum affects institution-level earnings; it explicitly says program-level calculations were unaffected. We use the institution file only for directory context. Original documentation and errata accompany the download.

ACD selects core measures, separates shared groups from campus relationships, decodes missingness, documents cohorts and independently verifies every prepared CSV cell. Original sources, lossless staging, processing and customer publication have separate retained identities for offline replay.

Government downloads are free. The official catalog lists Creative Commons Attribution without a version. Source credit and modification details accompany our preparation; no government endorsement is implied. Your $29 purchase covers this fixed edition, including processing improvements and documented publisher corrections to its scope. New source editions may be sold separately.

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