Note: the PATH in each python script is written with the assumption the csv file is in the Resources directory while the script is in the PyBank/PyPoll/PyBoss directories
In the PyBank challenge, I wrote a python script to analyze the records in order to calculate: the total number of months included in the dataset, the net total amount of "Profit/Losses" over the entire period, the average of the changes in "Profit/Losses" over the entire period, the greatest increase in profits (date and amount) over the entire period, and the greatest decrease in losses (date and amount) over the entire period
Note: The values my program calculated were not exactly the same as the image shown on the HW readme, but after opening the csv in excel (since it's a small data set) and running the average function and sorting the data (in both ascending and descending order) I got the same results as my program.
Additional Resources I used: https://stackabuse.com/saving-text-json-and-csv-to-a-file-in-python/ https://stackoverflow.com/questions/7422453/python-change-type-of-whole-list https://stackoverflow.com/questions/36571560/directing-print-output-to-a-txt-file-in-python-3 https://pyformat.info/
In the PyPoll challenge, I wrote a python script to analyze the votes 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, and the winner of the election based on popular vote.
Additional Resources I used: https://www.geeksforgeeks.org/python-program-to-find-largest-number-in-a-list/ https://stackoverflow.com/questions/45635242/how-to-get-the-key-from-value-in-a-dictionary-in-python https://stackoverflow.com/questions/5904969/how-to-print-a-dictionarys-key
In the PyBoss challenge, I wrote a python script to convert the employee records to be in the following format where: the Name column is split into separate First Name and Last Name columns, the DOB data is re-written into MM/DD/YYYY format, the SSN data is re-written so the first five numbers are hidden from view, and the State data is re-written as simple two-letter abbreviations.
Additional Resources I used: https://gist.github.com/afhaque/29f0f4f37463c447770517a6c17d08f5 https://www.quora.com/How-do-I-rearrange-nested-lists-in-Python-so-that-the-order-of-the-sub-lists-does-not-change-but-the-order-of-the-items-within-the-sub-lists-does https://stackoverflow.com/questions/41925504/how-to-join-every-sublist-to-a-single-string-in-python