We are compiling data from the election_results.csv file to categorize the data into a more readable structure for the election commission
-
Set a For Loop to retrieve each county's votes and divided their individual amounts by the total votes(369,711), then multiplied by 100 to get their specific percentages
- Made a For Loop almost identical to the previous one, this time we swap in the candidates names and divide their votes by the total amount(369,711)
This script can be adjusted by simply changing the root file that is being referenced, especially if the votes are calculated then put in a .csv with similar formatting(3 rows wide), it would almost be seamless and can be incorporated in future elections For larger scale elections you could always replace the "county" variables with something like "City" or "State" if your data is more wide spread