/more-money-more-problems

This project was written in Python and analyzed the effects of PAC money on US politics.

Primary LanguageJupyter Notebook

screen shot 2018-11-01 at 11 49 15 am


Summary:

The Python scripts and IPython notebooks in this repo collect, clean, preprocess and perform topic modeling on all Tweets of the current members of the US Congress. They also introduce campaign finance information for each member of Congress and investigate the relationship between the amount of PAC (Political Action Committee) members receive to finance their campaigns and what they Tweet about. In addition, this map shows the amount of money PACs contributed to the campaigns of incumbent members of the U.S. House of Representatives in 2018.


screen shot 2018-10-01 at 3 43 05 pm


This repository includes:

  1. get_congress_tweets.py: gets the Tweets of all the current members of the US Congress, and writes the Tweets and select Tweet metadata as CSV files

  2. partial_data_eda.ipynb: reads in Senator Amy Klobuchar's Tweets performs EDA on the them

  3. tweets_to_pickle.ipynb: reads all Tweets from CSV files and then pickles the data

  4. full_data_clean_preprocess.ipynb: reads all Tweets from pickled file, performs EDA, cleans and preprocesses the Tweets in preparation for topic modeling

  5. congress_metadata.ipynb: downloads metadata for each Congress member, and resolves discrepancies between the Twitter usernames listed in the Congress metadata and those listed alongside the Tweet data

  6. topic_modeling.py: reads preprocessed Tweets from pickled file, converts preprocessed Tweets to a matrix of token counts, and performs Latent Dirichlet Allocation to derive topics from and assign topics to the Tweets

  7. campaign_finance_data.ipynb: downloads campaign finance information for each relevant member of Congress

  8. campaign_finance_eda_aggregate_pac.ipynb: performs EDA on aggregate campaign finance data for current Congress members, and aggregates PAC contribution totals for each relevant member of Congress

  9. topic_pac_analysis.ipynb: shows the amount of PAC money received by Congress Members by state, party, etc., abbreviates topics for analysis, shows the top Tweet topics by Congress Members who received the most and least money from PACs to finance their most recent campaigns, and explores the high level differences between in PAC contributions depending on what Congress Members Tweet about

  10. Map.md: shows the amount of money PACs contributed to the campaigns of incumbent members of the U.S. House of Representatives in 2018

  11. Presentation.pdf: presentation of process and results