As an introduction to Python, this course explored the foundations of data analysis and visualization using a variety of powerful libraries, including pandas, geopandas, contextily, matplotlib, numpy, seaborn, and plotly. The project below demonstrates the practical application of these tools. Inspired by the recent U.S. election, we focused on analyzing voter behavior and the factors influencing the race between Kamala Harris and Donald Trump.
Our analysis utilized data from the AP Votecast exit survey, a primary resource for understanding the motivations and priorities of voters. Exit surveys are designed to capture insights into the issues and values that shape voter decisions. For this project, we honed in on the 2024 primaries, exploring the profiles of voters who participated and identifying the key drivers behind their choices. By analyzing this data, we aim to uncover trends and patterns that provide a clearer understanding of the election outcome.
LOCALIZE THE DATA
The analysis by AP VoteCast for the 2024 presidential primaries focuses on three key states: Iowa, New Hampshire, and South Carolina, due to their historical and strategic importance in the U.S. presidential nomination process.
These states were chosen for their early impact on the presidential elections and their ability to influence public perception and the strategic decisions of the candidates.
source shp: https://www.census.gov/geographies/mapping-files/time-series/geo/cartographic-boundary.html
DEMOGRAPHICS OF THE SURVEY RESPONDENTS
Before analyzing the data, it is essential to assess its limitations, including potential gaps in respondent representation and any inherent biases in the survey.
Of those surveyed, the majority are men over 65 years of age, and NOT shocking, women respondents earn less money than men.
POLITICAL AFFILIATIONS OF THE SURVEY RESPONDENTS
Fewer than half of the respondents identify as being “very” attached to their political party’s ideology, with the majority describing their beliefs as moderate. The majority of respondents are white and Republican, followed by white and Democrat.
So far the majority of respondents are white males, with annual incomes over 100,000 dollars. Most of them are conservative and identify with the Republican party.
Among the political issues they are most concerned about are: immigration, the economy and health care.
KEY ISSUES
Within these topics, we will now look at three themes we found especially interesting: Income Distribution, Immigration, and Abortion.
VOTING HABITS
As this was a Primary Exit Survey rather than a Final Election Exit Survey, we were interested in determining whether the respondents planned to vote in the actual election.
More people from this survey plan to NOT vote in the 2024 election than in 2020.
CONCLUSION
The first conclusion is that the respondents of the survey are predominantly high-income, older males. This could be because individuals in this high-income sector may have more free time to participate in surveys.
As is commonly known, we found significant income inequality. There are more women in the lower income brackets, but there is also a notable disparity in the higher income ranges. This occurs even though the gender distribution across age groups is similar. Across all income ranges, the proportion of Republicans and Democrats is more balanced among females than among males.
Immigration was the most important topic across all income ranges, except for the lowest income bracket, where Economy/Jobs held equal importance to Immigration.
We found that African Americans are the only ethnic group where Democrats received more votes compared to other ethnicities.