The project is to analyse a large excel dataset of a county's election results using python.
The purpose of the analysis is twofold -
- to harness the power of python to extract and analyse an excel dataset and,
- produce a readable and well formatted results report contaning key information such as - winner, total number of votes cast, votes and percentages for each candidate and county, and largest voters turnout from the list of counties.
-
The total number of votes cast in the congressional election was - 369,111.
-
The number and percentage of votes by county were: -Jefferson: 10.5% (38,855) -Denver: 82.8% (306,055) -Arapahoe: 6.7% (24,801)
-
Denver had the largest voter turnout.
-
The number and percentage of votes for each candiddate were: -Charles Casper Stockham: 23.0% (85,213) -Diana DeGette: 73.8% (272,892) -Raymon Anthony Doane: 3.1% (11,606)
-
The winning candidate was - Diana DeGette with a vote count of 272,892 and vote percentage of 73.8%.
Following is the screenshot of the election_analysis.txt file which was generated within seconds of running the python script:
The project's python script is an efficient solution to generate an easy to read election results report within seconds by reading and processing a large excel dataset. It would be an asset in streamlining elections results anaylsis in the future by saving significant time and effort for election workers and also minimizing possibilities of errors.
And with further enhancements the script could be utilised to generate result reports for any election. Some modifications could include:
- adding functionality to read data from other sources and formats such as those in APIs, json files and more.
- adding further checks and logic to fill in the gaps in case of empty data cells or erroneous data.
