An analysis of the 2020 US Presidential election. Medium article.
The 59th quadrennial US presidential election was held on Tuesday, November 3, 2020. To win the election, the candidate needs as a minimum 270 out of 538 electoral votes.
This project hopes to better explain the election results by use of official data, and aims to illustrate the answer to three questions, as defined below:
- Which state had the absolute highest number of votes placed in the presidential election?
- Which states were won by which candidate in the presidential election?
- What is the distribution of non-major party votes per state for the presidential election?
The dataset was obtained from Kaggle: https://www.kaggle.com/unanimad/us-election-2020
For this project, Numpy, Pandas and Plotly were used. Furthermore, it was developed as a Google Colab notebook.
- us_elections_20.ipynb Jupyter Notebook with the analysis and code.
- archive.zip The election dataset collected from Kaggle. Furthermore, an additional dataset with US state names and initials was added to the archive (also collected from Kaggle).
- Based on the data, California is the state with the highest amount of votes by a comfortable 6 million lead.
- The generated interactive map illustrates which states were won by which candidate; states with the color blue (all shades) were won by the Democratic Party candidate. States with the color red (all shades) were won by the Republican Party candidate. The darker the shade the bigger the lead for the corresponding party.
- Although there are a number of non-major parties involved in the presidential election, the highest voted "third-party" in every state is the Libertarian Party, with the most votes taken in South Dakota (11095, 2.625 %), followed by North Dakota and Utah.
Thanks to Raphael Fontes for gathering and publishsing the dataset to Kaggle. In addition, I'd like to thank Ashish Gupta for inspiring the visualization approach (link).