Microproduct data guidebeginner

MEDSL County Presidential Returns

County-level U.S. presidential election returns for building result maps and turnout comparison tools from MIT Election Data and Science Lab files.

At a glance

Difficulty
Beginner — comfortable for a first prototype
Size
Tiny · ≤0.05 GB
Formats
CSV, DTA
Access
Download
API key
Not required
Provider
MIT Election Data and Science Lab
Updates
Occasional

From source to product signal

Test a product idea in four steps

MEDSL publishes county presidential returns on Harvard Dataverse. Start with one election year and two-party totals. County shapefiles, third-party votes, and certified state files can disagree, and this is not precinct data.

1

Check the setup

  • Python 3.10 or newer
  • A notebook environment such as Jupyter or Google Colab
  • An internet connection
2

Access the data

  1. 1.Open the MEDSL data page and follow the county presidential returns Dataverse record.
  2. 2.Download the CSV for the latest presidential cycle.
  3. 3.Keep year, county FIPS, Democratic votes, and Republican votes.
Open official source
3

Run the Python example

Install the packages, then run the notebook cell.

python -m pip install pandas

import pandas as pd

returns = pd.read_csv(
    "https://dataverse.harvard.edu/api/access/datafile/6188156",
    encoding="latin-1",
)
print(returns.head())
4

Test a useful signal

Map one year's county presidential margins

Test whether county returns can power a bounded result-map prototype.

  1. 01Filter to one year and keep county FIPS plus Democratic and Republican votes.
  2. 02Compute two-party vote share and list counties with missing FIPS.
  3. 03Explain that county totals can differ from certified state files and are not precinct results.

Dataset details

MIT Election Data and Science Lab is an academic source. Last verified 2026-08-18. Temporal coverage: presidential general elections compiled by MEDSL.

Theme

Government & Policy

Domains

ElectionsPublic Policy

Data types

TabularGeospatial

Tasks

Election AnalysisMappingTurnout Comparison

Geography

United States

Formats

CSVDTA

Provider

MIT Election Data and Science Lab

Data terms

Creative Commons CC0 1.0 Universal