Bar_Race_Data_Manipulation

First we need to import necessary library

In [ ]:
import pandas as pd

This data is collected from microsoft bing dataset, which will be updated almost everyday

In [ ]:
data =  pd.read_csv('https://raw.githubusercontent.com/microsoft/Bing-COVID-19-Data/master/data/Bing-COVID19-Data.csv')

Convert this csv file to a pandas dataframe object

In [ ]:
df =  pd.DataFrame(data)

Data Cleaning

In [ ]:
clean_df = df.drop(df[pd.notna(df.AdminRegion1)].index)
In [ ]:
clean_df.head()

NOw select the coloumn that only needed

In [ ]:
new = clean_df[['Updated', 'Confirmed', 'Country_Region']].copy()
In [ ]:
new

We want to date in the column value, thats the flourish website requuirement

In [ ]:
medals = new.pivot_table('Confirmed', ['Country_Region'], 'Updated')
In [ ]:
medals.tail()
In [ ]:
medals.head()

Save data in a Csv file

In [ ]:
medals.to_csv("flourish.csv", encoding='utf-8')

After that go to https://app.flourish.studio/

Select the template for bar race

Upload flourish.csv file there

YESs! your covid bar race prepared. publish it



.