Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save matteo-peltarion/61bfbbe34c4aaba84af400ae8331fe3d to your computer and use it in GitHub Desktop.
Save matteo-peltarion/61bfbbe34c4aaba84af400ae8331fe3d to your computer and use it in GitHub Desktop.
COVID-19 analysis code 03 - data preprocessing
# 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