We were given two datasets for this assignment. Using the 'budget_data.csv' we had to perform analysis in order to answer the below queries.
- 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 second dataset was 'election_data'. Here we had to find answers to below items.
- 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
Please note that my code says 'election_data_1.csv' as I had issues loading the csv and copied the data into another csv just to rule out a problem with the data instead of the code.
I worked on this assignment in Visual Studio Code. I imported two dependencis (os and csv) to enable the loading of the csv file and being able to work with it.
Due to some error messages repeatedly coming up with code which was provided in class, I resolved to searching on Stack Overflow for alternatives. Also, I had to raise a question to askBCS as my PyPoll results were giving numbers instead of names. A useful advice I received was that in Visual Studio Code, opening a different (or too many folders) can interfer with the code if the source folder is used for different files than what is being used (eg. Resources folder is present in every exercise folder and hence interfers with the resources folder containing the csv for the analysis).