<jupyter_start><jupyter_text><jupyter_code>from google.colab import drive
drive.mount('/content/drive')
ls '/content/drive/My Drive/Colab Notebooks/Twitter.properties'
!pip install ConfigParser
import pandas as pd
import configparser

corona_confirmed_df = pd.read_csv('https://raw.githubusercontent.com/CSSEGISandData/COVID-19/master/csse_covid_19_data/csse_covid_19_time_series/time_series_covid19_confirmed_global.csv')
corona_confirmed_df.head()
corona_death_df = pd.read_csv('https://raw.githubusercontent.com/CSSEGISandData/COVID-19/master/csse_covid_19_data/csse_covid_19_time_series/time_series_covid19_deaths_global.csv')
corona_death_df.head()
corona_recovered_df = pd.read_csv('https://raw.githubusercontent.com/CSSEGISandData/COVID-19/master/csse_covid_19_data/csse_covid_19_time_series/time_series_covid19_recovered_global.csv')
corona_recovered_df.head()
corona_confirmed_df = corona_confirmed_df.melt(id_vars=['Province/State','Country/Region','Lat','Long'])
corona_confirmed_df.head()
corona_confirmed_df = corona_confirmed_df.rename({'variable':'Date','value':'Confirmed'},axis = 'columns')
corona_confirmed_df.head()
corona_death_df = corona_death_df.melt(id_vars=['Province/State','Country/Region','Lat','Long'])
corona_death_df = corona_death_df.rename({'variable':'Date','value':'Death'},axis = 'columns')
corona_death_df.head()
corona_recovered_df = corona_recovered_df.melt(id_vars=['Province/State','Country/Region','Lat','Long'])
corona_recovered_df = corona_recovered_df.rename({'variable':'Date','value':'Recovered'},axis = 'columns')
corona_recovered_df.head()
combined_df = [corona_confirmed_df, corona_death_df, corona_recovered_df]
combined_df = [df.set_index(['Province/State','Country/Region','Lat','Long','Date']) for df in combined_df]
combined_df = combined_df[0].join(combined_df[1:])
combined_df.head()
combined_df = combined_df.reset_index()
combined_df.head()
combined_df[['Lat','Long','Confirmed','Death','Recovered']] = combined_df[['Lat','Long','Confirmed','Death','Recovered']].apply(pd.to_numeric)
combined_df[['Date']] = combined_df[['Date']].apply(pd.to_datetime)
combined_df.Lat = combined_df.Lat.astype(int)
combined_df.Long = combined_df.Long.astype(int)
combined_df.Confirmed = combined_df.Confirmed.astype(int)
combined_df.Death = combined_df.Death.astype(int)
combined_df.Recovered = combined_df.Recovered.fillna(0.0).astype(int)
combined_df.dtypes
combined_df.head()
combined_df = combined_df.rename({'Province/State':'State','Country/Region':'Country'},axis = 'columns')
combined_df.head()
combined_df.isnull().any()
combined_df.count()
combined_df.set_index('Country').filter(like="India",axis=0)
combined_df[combined_df.State.isnull()]['Country'].value_counts()
!pip install -U googlemaps
import googlemaps
gmaps = googlemaps.Client(key=config.get('twitter','googleapikey'))
geocode_result = gmaps.reverse_geocode((-24.4425, 58.4438))
print(geocode_result[0])
print(geocode_result[0]['formated_address'])
print(geocode_result[0]['formated_address'].split(",")[-2].strip(" "))<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.16067929457870672, 'fraction_numerical': 0.014696276943174396, 'mean_word_length': 11.301204819277109, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 3, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '33253', 'license': 'MIT', 'n_tokens_mistral': 1181, 'n_tokens_neox': 1120, 'n_words': 101, 'path': 'Coronavirus_Dataset_Enrichment.ipynb', 'repo_name': 'Sayantanvisca/coronavirus-analysis', 'size': '3062'}