On November 3rd, the entire US House of Representatives and one third of the US Senate are up for election, along with a large number of statewide offices. American elections involve huge amounts of money — and this time, it's more than ever before, according to the Washington Post (https://www.washingtonpost.com/politics/2026/10/07/extraordinary-amount-money-pouring-into-midterm-elections/).
Campaign donations are monitored and regulated by the Federal Election Commission (FEC), which normally has representatives from both major parties. The FEC isn't able to do much right now, because it's missing a quorum of commissioners. But it does still collect and publish information about campaign spending. I've heard a number of analysts describe these reports as as proxies for how each party believes it'll do in November -- a prediction market, of sorts, where they put more money where they feel they have a fighting chance, but not a sure thing.
This week, we'll be looking at some of this FEC data, and what it says about election spending.
Data and five questions
This week's data comes from the FEC site. The main page for downloads is at https://www.fec.gov/data/browse-data/?tab=bulk-data . From that page, we want:
- Candidate master (2025-2026 data, plus headers)
- Committee master (2025-2026 data, plus headers)
- Candidate-committee linkages (2025-2026 data, plus headers)
- All candidates (2025-2026 data)
Note that many committees are not connected to a candidate. That's because every candidate needs at least one committee (i.e., one campaign)
Paid subscribers, both to Bamboo Weekly and to my LernerPython+data membership program (https://LernerPython.com) get all of the questions and answers, as well as downloadable data files, downloadable versions of my notebooks, one-click access to my notebooks, and invitations to monthly office hours.
Learning goals for this week include: Joining, grouping, data cleaning, and plotting with Plotly.
Here are my five questions and tasks for this week. I'll be back tomorrow with my solutions and explanations.
- Read the first three files (candidate master, committee master, and candidate-committee linkages) into data frames, using the separate header files to name the columns in each resulting data frame. Combine the three data frames into a single one, such that we can get information about each committee, its possible linkage to a candidate, and (if there is a candidate) information about that candidate.
- How many committees are associated with a candidate? How many are not? How many candidates have more than one committee? How many committees are jointly run by more than one candidate?