Due Tuesday, November 13th at 11:59pm
For this project you are going to write Python programs that analyze presidential polling data.
You will be working with data from the website http://electoral-vote.com.
In particular, you will use the CSV (comma separate values) file here: http://www.electoral-vote.com/evp2012/Pres/pres_polls.csv
Here are the programs that you need to write:
python states_by_electoral_votes.py pres_polls.csv
This program will output the a list of states and the District of Columbia sorted by the number of electoral votes for each state.
python find_dem_states.py pres_polls.csv
Output only democratic states sorted by highest percent to lowest percent based on the latest poll for each state. A dem state is one in which the dem_poll > gop_poll. Sort by the difference of dem_poll - gop_poll.
python find_gop_states.py pres_polls.csv
Output only republican states sorted by highest percent to lowest percent based on the latest poll for each state. A gop state is one in which the gop_poll > dem_poll. Sort by the difference of gop_poll - dem_poll.
python find_tie_states.py pres_polls.csv
Output the states that tied in the latest poll.
Get the final popular vote results by state and put into a file: final_votes.csv.
python fine_closet_polls.py pres_polls.csv final_votes.csv
For each state output the poll (pollster and date) that best predicted the election.
python find_best_poll.py pres_polls.csv final_votes.csv
Find the overall pollster that best predicted the election.
Use PyGame to write a program that can chart the polls for a list of states.
python chart_polls.py <state1> [<state2> ...]
python chart_polls.py CA NV WA OR