Last active
March 23, 2020 17:05
-
-
Save matteo-peltarion/61bfbbe34c4aaba84af400ae8331fe3d to your computer and use it in GitHub Desktop.
COVID-19 analysis code 03 - data preprocessing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Save the country's name in a variable, so that it can be easily changed to show data | |
# from another country. | |
country_name = "Italy" | |
# Get data for a single country, sorted by date | |
country_df = world_df[world_df['Country/Region'] == country_name].sort_values(by='Date') | |
# Compute daily increase, in absolute number | |
country_df['Increase'] = country_df['Confirmed'].diff() | |
# Print the last 5 rows of the dataframe | |
country_df.tail() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment