For this assignment I had to complete two Python challenges named "PyBank" and "PyPoll"
For the PyBank challenge I had to create a Python scipt that analyzed the financial records of a company. Provided was the budget_data.csv dataset that inlcude two columns named "Date" and "Profit/Losses".
The challenge was to create a Python script to analyze these records and calculate the:
- The total number of months included in the dataset
- The net total amount of "Profit/Losses" over the entire period
- The changes in "Profit/Losses" over the entire period, and then the average of those changes
- The greatest increase in profits (date and amount) over the entire period
- The greatest decrease in profits (date and amount) over the entire period
The final results looked like this:
The final script prints to the terminal and exports the file as a text file into an "analysis" folder.
For the second challenge, PyPoll, I had to create a Python script that analyzed the election results of a small, rural town. I was given a dataset with three columns that included "Voter ID," "County", and "Candidate".
The challenge was to create a Python script to analyze the vote and calculate:
- The total number of votes cast
- A complete list of candidates who received votes
- The percentage of votes each candidate won
- The total number of votes each candidate won
- The winner of the election based on popular vote
The final results looked like this:
The final script also prints to the terminal and exports the file as a text file into a seperate "analysis" folder.
Both scripts also store the header rows into csv_header.