Contains two sample python scripts to read csv data and output aggregate metrics to a text file
Download folder structure
There are two folders: PyBank and PyPoll
- Both contain a Resources folder with a csv file and an Analysis folder with an example output text file
- There is a "main.py" python script file in each folder
- Run the "main.py" script from the appropriate folder to read the csv file and produce the output text file ("analysis.txt")
PyBank
- Contains a python script to calculate aggregate metrics
- The csv file "budget_data.csv" is a simplified finacial file with only two columns (date and profit/losses)
- "main.py" python script will read in the data from the csv file and produce the following metrics to an output text file:
- Total months
- Total profit/losses
- Average net change of profit/losses (difference from month to month)
- Greatest net increase in profits (difference from month to month)
- Greatest net descrease in profits (difference from month to month)
PyRoll
- Contains a python script to calculate aggregate metrics
- The csv file "election_data" contains 3 columns (Voter ID, County, Candidate)
- "main.py" python script will read in the data from the cvs file and produce the following to an output text file:
- Total number of votes cast
- List of candidates that received votes
- Percentage of votes each candidate won
- Number of total votes per candidate
- Winnder of election based on popular vote
The code in this project is licensed under MIT license.