Where Did the Vote Go?

Research

Municipal-level analysis of Brazil's 2026 election with TSE and IBGE data, with an interactive report on labs.

The result nobody expected

Everyone around me expected a different result in Brazil's 2026 election, and the easy explanations showed up the same night: Lula's voters stayed home, the poor turned right, the Northeast held. I half believed some of them. I wanted to know which ones survived the actual numbers.

Checking instead of guessing

Nobody asked for this. It was my own question, which meant the bar was simple: use only public data, say where the data stops, and be willing to drop an explanation I liked. The TSE publishes results by polling section and the IBGE census has income, race, religion and education by municipality, so the honest unit of analysis was the municipality, never the person.

Notebooks first, report second

I built three Python notebooks with pandas and statsmodels: one for abstention, one for the historically left municipalities that flipped, and one for income and region. They join TSE results from 2002 to 2026 with the 2022 census, classify parties into left, center and right, and run within-state regressions of the left vote on standardized census variables, so a coefficient reads as points of vote per standard deviation with the state held fixed.

An export script then pulls the aggregates into a typed data file for the labs app, where the report renders them as interactive Recharts figures in English and Portuguese. Before publishing I cross-checked every number in the text against the notebooks, and a few claims did not survive that pass.

What held up, and what I can't claim

Abstention barely moved and fell in the most Lula-leaning places; votes moved instead. The flip of historically left municipalities is mostly a 2018 pattern repeating, concentrated in the South, Southeast and Midwest. Within the same state, the share of Black and mixed-race residents tracks the left vote far more than income does, and the evangelical association jumped in 2018.

All of it is ecological: it says where, not who. The party classification is my own judgment and the predictors are associations rather than causes. The report lives on labs, and the notebooks, scripts and party classification are public in rckbrcls/labs.

Built with

Python / pandas / statsmodels / Next.js / TypeScript / Recharts