Skip to content

pycensus.census.countries.usa.elections_precinct.unofficial.medsl

MIT Election Data + Science Lab (MEDSL) 2024 precinct-level returns (Harvard Dataverse, doi:10.7910/DVN/NYTPDU) -- UNOFFICIAL.

One file per state with the state's own precinct label (precinct), county_fips, office, party_simplified and votes by vote mode (some states also carry a TOTAL mode that equals the sum of the others: it is used when present, else all modes are summed). It has no geometry and no Census voting-district code, so a precinct only gets a polygon when the state publishes boundaries keyed by the same label (checked on Delaware, where all 533 precincts equal the official report, and Hawaii, where the statewide totals are exact). Matching to Census VTD NAMEs alone is not reliable (0-52% of precincts matched on NE, PA, KS, MO, NC, DE).

load_president(state_abbr, cache_dir=None)

Presidential votes by (county_fips, precinct): columns county_fips, precinct, votes_dem, votes_rep, votes_total.

Parameters:

Name Type Description Default
state_abbr str

State abbreviation.

required
cache_dir

Cache folder; None = the pycensus cache.

None