Mapping Presidential Candidate Support Part 1: Pennsylvania

PA Donor Map

Challenge Accepted

Time for me to dive into this insane election. A friend of mine (who lives in NoLibs) recently made a passing comment to me that “almost everyone in South Philly is a Trump supporter.” This was a ridiculous statement from a friend who loves to troll me about my love of South Philly. Nevertheless, I decided to try to figure out who Philly supports in the upcoming Presidential election and where they are. Challenge accepted. I don’t have polling data and I am not about to start calling my neighbors, but we all have access a lot of campaign finance data.

We all know that Philadelphia is a heavily Democratic city, so I expected donations to the Hillary Clinton campaign would far outnumber those for Donald Trump. But surely there are people in Philadelphia that are donating to Trump, right?


I started this project looking only at Philadelphia. The Philly data alone is fairly boring, so I expanded my scope to all of Pennsylvania. The output map can be found via direct link here, though more details on actual amounts and trends are below.


The Federal Election Commission (FEC) releases campaign finance data, including individual contributions by citizens. It gets a little tricky here, because donations tend to go to political committees and not the candidate themselves, so I had to do some investigating and link each political committee to their candidate. According to the FEC, each candidate is directly connected to three committees. Using Python, I filtered the nationwide list of donations to only include Philadelphia (and later, Pennsylvania) zip codes, and created a list of unique donors. I then summarized these by zip code and mapped it. You can see more on how I did this in the script at the end of the article. I used the output of the script to do the secondary analyses below.


I noticed three serious limitations to analyzing support in this way. Perhaps most importantly, the FEC only reports donors who have given a total sum of $200 or more across all of their contributions. This means the data is likely missing the vast majority of small donors. It may also bias the results toward more wealthy donors. Despite this, I do believe that it is enough to show general areas of support. Second, I can only account for contributions given to the six committees directly tied to the candidates’ campaigns. This means any other PAC or ‘dark money‘ organization that took donations from individuals and then contributed to the candidates are not counted. Finally, while the data was last updated on October 16, there is a noticeable drop in reports after September 1st. It is likely that these records are incoming, but haven’t hit the FEC site as of this writing.

One more thing: I’ve chosen to look at only Clinton and Trump donors, as they’re the obvious front-runners in this election. If I were going to map a state like Utah, I’d probably need to look at third party candidates.

Philadelphia Results

As I stated before, I was pretty sure there would be far more donors to Clinton than Trump. I was not expecting a split this large. In total, between April 2015 and the end of September 2016, For the Clinton/Kaine campaign, there were 6,672 donations, totaling over $1.2 million, coming from 1,646 people. For Trump/Pence, just 82 donations, totaling $13,228, from 45 people. For Clinton, this comes to an average donation of $183.66, or $744.46 per individual. For Trump, it’s an average donation of $161.32, or $293.96 per individual.

I used Carto to quickly throw the results onto a web map. Below are two maps showing the distribution of unique donors by zip code in Philly. Using Carto’s built-in SQL feature, I filtered the shapes to only show zip codes where donations were made (i.e., SELECT * FROM donorcountzips WHERE trump != 0).

Below charts demonstrating how fundraising accumulated over time. The first shows the number of unique donors giving to the campaigns since April of 2015. The second shows, in raw dollars, how much was raised.

Sum of Individual Donors Over Time – Philadelphia

Total Dollars Collected Over Time – Philadelphia

Overall, I find the Philly results to be fairly uninteresting. The difference is so big that I can’t have all that much fun with it. Because Clinton beat Trump in fundraising in almost everywhere, there’s not much to show about who “won” a zip code. Let’s expand the scope a bit.

Pennsylvania Statewide Results

Using the same methodology, I filtered the raw data to all Pennsylvania zip codes. For this, I added a second step of determining who had the majority of donors and what percent of donors they took. I then created a bivariate map (explained in “the code” section below) to illustrate who had more donors and by how much.

From the data, we see that Clinton maintains a huge donor advantage statewide. She received over $3.75 million from 8,683 donors. This is an average of $432.76 per individual. Trump received just $610,397 from 1,612 donors, at an average of $378.66 per individual.

The map below shows the distribution of these donors across the state. Unlike the Philly maps, this shows which zip codes contributed more to each candidate. They are colored by percent of the total donor count that went for the majority candidate. Keep in mind that some area may only have a single donation to a single candidate, so an area that is 100% for Clinton may only have 1 donation to her and be next to an area that is 75%, but has 3 donations to 1 for Trump. You can click each zip code to find more details.

Sum of Individual Donors Over Time – Pennsylvania

Total Dollars Collected Over Time – Pennsylvania


Pennsylvania is regarded as a swing state, though it has not voted Republican in a Presidential campaign since George H.W. Bush in 1988. Still, the votes are close, dancing around a 50/50 split in all recent elections. I expected to see a closer split in the statewide data. Trump did much better across the entire state, scoring 16.24% of Clinton’s net statewide versus just 1.08% in Philadelphia alone. I also expected to see a greater divide between the larger cities and the center of the state. Pundits have been calling this… *groan*… the “Pennsyltucky effect” for longer than I’ve been alive. Clinton seems to have had the upper hand across all parts of the state, whether due to higher levels of support or a more active presence.

I get the impression from a quick look at the data that Trump’s deficit may be explained by a poor campaign ground game. He announced his campaign on June 16, 2015, but did not make any significant fundraising gains in the state until early 2016. Still, fundraising didn’t really take off for him until May or June of 2016 when he became to obvious front-runner of the crowded GOP primaries. Clinton, on the other hand, announced her campaign on April 12, 2015 and immediately began receiving donations. She received over $22000 by the end of business on April 13th. She’s had a steady, almost linear, stream of donations since.

Polls are probably a better way to determine support for a candidate, but if we’re to use this data as an early indication of who might win the state, Clinton has the obvious advantage. As of writing, FiveThirtyEight gives Hillary Clinton an 87.9% chance to win Pennsylvania. No surprises there. With all of the talk of the media rigging polls and massive voter fraud in Pennsylvania, we can point to individual campaign donations to support polling results.

The Code

The nationwide list is something like 11 million rows and over 2.5 GB. I wrote a quick Python script to search the text file for all donations from Philadelphia and again for Pennsylvania, and assign which candidate the donor was effectively supporting by matching the campaign committee IDs with the candidate IDs. The script then searches that filtered list for unique donors. This was done by using the name, zip code, and occupation entries. I think there’s a pretty good chance that very few donors would share all three, but it’s possible that some donors have been omitted. Here’s the code. It’s not pretty because I wrote it sort of stream-of-consciousness, but it works:

For the statewide results, I created the bivariate map using CartoCSS using a value-by-alpha approach. I borrowed heavily from work done on Kyle Walker’s map on religious adherence map. The CartoCSS selects the majority candidate (or the tie or the neither) and sets the color, then sets the alpha by the percent of the total donors. Here’s the code:

Leave a Reply

1 Comment on "Mapping Presidential Candidate Support Part 1: Pennsylvania"

Notify of
Sort by:   newest | oldest | most voted
Kevin H

Great stuff Wes.