Day 23: Easy Bar Chart Race Animation Tutorial

Aug 24, 2022

Data: https://covid19.who.int

Graph: https://public.flourish.studio/visualisation/11001005/

Code:

import pandas as pd
df = pd.read_csv('WHO-COVID-19-global-data.csv')

countries = ['China', 'United States of America', 'The United Kingdom', 'Sweden',
'India', 'Japan', 'South Korea', 'Germany', 'Mexico']
df_small = df[df['Country'].isin(countries)]

col = 'Cumulative_cases'

df_small_small = df_small[['Date_reported', 'Country', col]]
df_pivot = pd.pivot_table(df_small_small,values=col, index='Country',
columns='Date_reported').reset_index(drop=False)

df_pivot.to_csv('claned.csv', index=False)

Want a step-by-step process for making killer projects that will land you your next job? 

Learn About Project Studio