Tracking Partisan Shifts Across American Counties
The Evershifting Landscape Of American Politics A Map Of USA Political Party Trends Most people looking at how US voting patterns change over time reach for Google and find a dozen animated maps that look impressive but don't actually teach you anything. The problem isn't the maps. It's the data pipeline behind them. If you want to understand real partisan movement — not just confirm what you already think — you need to work with raw election results and do a bit of legwork.
Where the data actually lives
The MIT Election Data Lab is the single best starting point. They publish precinct-level and county-level results going back to 1916, cleaned and harmonized. The download is free. You don't need an account. The files are big — the full historical dataset is around 2GB as a ZIP — and they come in Stata, SPSS, and R format. If you're comfortable with Python, you can read the CSV exports directly into pandas without much friction. The Federal Election Commission website has federal results only. That's useful if you specifically need House and Senate margins down to the ballot style, but it's useless for state and local races, which is where most of the actual partisan realignment shows up. County clerks hold the granular stuff, and their data formats vary so wildly that automating collection from all 3,143 counties is basically impossible without significant engineering overhead.
What most people miss about the realignment
The narrative that the South "became Republican" is technically true but dangerously incomplete. The real shift happened at the county level over roughly forty years, and it wasn't uniform. White Democratic strongholds in the rural South flipped gradually from the 1960s through the 1990s, but many minority-majority counties in the same region stayed Democratic well into the 2000s. Meanwhile, suburban white counties in the Northeast and Midwest started moving Republican in the 1980s and then reversed course after 2008. One direction doesn't explain the whole picture. If you plot the Pearson correlation between county-level Democratic vote share in 1976 and 2020, you get something roughly around 0.65. That means about 42% of the variance in current Democratic performance is explained by where the county landed forty-four years earlier. The rest is noise, realignment, demographic change, and occasional single-issue disruptions. A correlation that high looks stable until you actually look at the scatter plot, and the outliers there tell the real story.
Get the Full Details

My own headache with geocoding cross-state counties
I spent three weeks last year trying to merge MIT's county FIPS codes with the Census Bureau's shapefiles for a project tracking swing counties between 2000 and 2020. The problem is that county boundaries change. Meriwether County, Georgia lost territory to newly formed Carroll County in 1868. Apache County, Arizona was carved out of Navajo in 1979. (King) County, Texas was split off from Bexar in 1876. Your geospatial join breaks whenever a county's geometry shifts between two election cycles, and the MIT data doesn't flag these boundary modifications explicitly. The workaround was to use the Census Bureau's County Boundary Annexation and Deannexation (CBAD) dataset, which tracks every boundary change since 1950. I mapped each FIPS code to its canonical geometry for the relevant year before joining to election results. It added about two days of work to the pipeline but eliminated roughly 180 false matches that were throwing off the analysis. Without that correction, I was assigning votes from merged counties to the wrong geographic unit and inflating Democratic margins in central Texas by several percentage points in the 1996 and 2000 results.
How to actually build a trend map
Here's the straightforward workflow that gets you usable results without turning it into a semester-long project: Download the MIT Election Data Lab's county-level presidential results for the cycles you need — 2000, 2004, 2008, 2012, 2016, 2020 covers the modern era adequately. Convert to CSV if needed. Pull the Census shapefile for the same years from census.gov/geography/mapping-files/. Use geopandas in Python to spatially join the election data to county geometries. Calculate the Democratic two-party vote share for each cycle. Compute the difference between cycles. Render with a diverging color scale centered on zero. A full run takes about 20 minutes on a decent laptop if you've already set up the environment. The first run is longer because you're resolving boundary mismatches and dealing with a few counties where the MIT data reports zero votes, which usually means the county existed in the census year but didn't have a presidential contest on record — rare, but it happens in some small New England counties before voting was centralized at the state level.
Tools that save time and ones that don't
PySAL's weights module is genuinely useful if you want to compute contiguity-based spatial lags of voting margins, which helps isolate whether a county's shift is correlated with its neighbors' shifts. That's a different question from "did this county change?" but it matters if you're building a predictive model. Tableau can make the final maps look polished, but its handling of FIPS code joins across years is fragile. I've watched it silently drop matching rows when a county's FIPS code changed mid-period, and the resulting map looks fine until you check the data behind it. PowerBI has the same issue. If you use either, validate your row counts against the raw MIT data after every join. You'll catch the silent drops that way. For rapid exploration, IPython with folium and a pre-loaded GeoJSON of US counties gets you an interactive map in under 50 lines of code. It's not production quality, but it's fast enough to test hypotheses before committing to a heavier pipeline.

Where this approach breaks down
Presidential-only data tells you almost nothing about down-ballot dynamics. A county that votes heavily Democratic for president might still send Republicans to the state legislature. The 2022 midterms showed this repeatedly in places like Maine's third district and western Virginia, where county-level presidential margins overstate Democratic strength at the state level. If you want the full picture, you need state-level results, and those aren't as cleanly assembled as the federal data. Turnout variation is another blind spot. A county shifting from 55% Democratic to 52% Democratic looks like a modest realignment, but if total turnout dropped from 75% of voting-age population to 42% between those cycles, the raw margin change means something different than the numbers suggest. The MIT data includes turnout estimates for recent cycles but not consistently for earlier ones, and reconstructing VAP figures requires pulling Census population data separately. Finally, third-party and write-in votes have grown in certain cycles and regions. In 2020, Jo Jorgensen pulled over 1.8 million votes nationally, concentrated enough in some rural counties to shift two-party percentages meaningfully. Two-party vote share calculations exclude those totals, which distorts the picture in states like Utah and Alabama where third-party performance exceeded 3% of the total vote.
The data exists. The tools are free. The main constraint is knowing which edge cases will quietly invalidate your results if you don't account for them.