Implementing system arguements allowing for execution through terminal/command promp
Choose if I want to execute parts of the analysis such as downloading the full dataset, representing world data, representing monthly data, etc...
The library datetime could have been used more often to obtain the current year and month, but was not used for internationally analysis for my own purposes of being able to see any month during any year through a simple input
Parsing through the dataframe for the total new cases for each month in the dataset
The first approach was clearly not the best as it was more so harcoding a solution, which in theory would take processing power that is truly not needed (referring to the dataframe more times than necessary)
The second approach was "better" but needed two for loops as I was unable to represent a single digit integer as a double digit integer with zero as pandas datarange represents all months in two digits
Both also were not equipped to handle the differenciationg of years, for example storing January 2020 separate from January 2021
This was mainly because the list generated was used to create another dictionary, then converted into a pandas series for graphical representation ==> manually listing out the months with their respected years would have been unnecessary hard coding
The third and final case implemented the library datetime to ensure the correct number of months are known while taking into account the year
Another list (monthly_tot) was added for a future analysis that is not currently implemented
Not under the impression of the pandemic spanning for over a year, the initial program was written not taking in account a second year
Resulted in forming another variable to represent year based from a cummulative number of months or an inputted year
Similar concepts were used in the state analysis
Due to reasons unknown, the dataset was one day behind with some of the countries, including the US, therefore, making the datarange function create a nan row for countries on the latest date
Implementing try and except inhibits the program from including a 0 datapoint mis representing the data
Another solution is including a conditional to compare the value using np.isnan to remove that data point from the dataframe
Although this is merely one case, compact for loops were used throughout the program to remove the use of multiple conditionals and the use of lambda also aided in generating a unique random number during each iteration of the for loop
After manually saving all graphs from the editor (spyder), then from the viewer that shows graphs from the function matplotlib.pyplot.show(); I utilized matplotlib.pyplot.savefig() to automatically download all graphs to the current directory and then upload them to this site