<jupyter_start><jupyter_text>Introduction to Folium<jupyter_code># importing Libraries
import folium
#creating world map
m = folium.Map()
m
#India Mao

india1 = folium.Map(location = [20.5937,78.9629],zoom_start=4.5)
#india1
# India Map with new Tiles
india2 = folium.Map(location = [20.5937,78.9629],zoom_start=4.5,tiles='Stamen Toner')
#india2
india3 = folium.Map(location = [20.5937,78.9629],zoom_start=4.5,tiles='Stamen Terrain')
india3<jupyter_output><empty_output><jupyter_text>Retreving the states information (Latitudes and Longitudes)<jupyter_code>#Installing the lxml to retreive tables from websites
conda install lxml
# importing padas for processing Data
import pandas as pd
#importing Latitudes and Longitudes
info = pd.read_html("http://www.quickgs.com/latitudinal-and-longitudinal-extents-of-india-indian-states-and-cities/")
#Converting information into DataFrame
data = pd.DataFrame(info[0])
#view Data
data
#Data cleaning Transforming Latitude and Longitude into algorithm compatible form
def data_pre(cord):
    return cord[0:5]
data['Latitude'] = data['Latitude'].apply(data_pre)
data['Longitude'] = data['Longitude'].apply(data_pre)
#Changing the data type from object to float
data['Longitude'] = data['Longitude'].astype('float')
data['Latitude'] = data['Latitude'].astype('float')
data.dtypes
data.head()<jupyter_output><empty_output><jupyter_text>Retreving Live Covid Cases Count all over India<jupyter_code>#Retreving the LIVE COVID19 Statistics
info2 = pd.read_html('https://en.wikipedia.org/wiki/COVID-19_pandemic_in_India',match='COVID-19 pandemic in India by state and union territory')
len(info2)
#Convert to DataFrame
covid19 = pd.DataFrame(info2[0])
covid19.head()
#Droping the first 2 rows
covid19.drop([0,1],inplace=True)
covid19.head()
#Making first row as index and droping last unwanted rows
header = list(covid19.iloc[0,:])
header[1]='State'
covid19 = covid19.iloc[1:-3,:]
covid19.columns = header
covid19.head()
#Making the two Datasets Compatible
state_data = list(data['State'])
covid19_state = list(covid19['State'])
missing =[]
for state in covid19_state:
    if (state not in state_data):
        missing.append(state)
missing


#adding Rows to Data
rows = [['Andaman and Nicobar Islands',11.74,92.65],['Lakshadweep',10.56,72.64],['Puducherry',11.94,79.80],['Telangana',18.11,79.01]]
data = data.append(pd.DataFrame(rows,columns=['State','Latitude','Longitude']),ignore_index=True)
data
covid19['S.No.'] = covid19['S.No.'].astype('int')
covid19 = covid19[(covid19['S.No.']!=6) & (covid19['S.No.']!=8) & (covid19['S.No.']!=9) & (covid19['S.No.']!=18)]
data['State']=data['State'].replace('Jammu & Kashmir','Jammu and Kashmir')
final_data = pd.merge(data, covid19, how ='inner', on ='State')
final_data.drop(['S.No.'],axis=1)<jupyter_output><empty_output><jupyter_text>add Markers to states<jupyter_code>for state,lat,long,total_cases,Death,Recov,Active in zip(list(final_data['State']),list(final_data['Latitude']),list(final_data['Longitude']),list(final_data['Total cases']),list(final_data['Deaths']),list(final_data['Recoveries']),list(final_data['Active cases'])):
    folium.CircleMarker(location = [lat,long],
                       radius = 5,
                       color='red',
                       fill = True,
                       fill_color="red").add_to(india1)
    folium.Marker(location = [lat,long],
              popup='<strong><b>State  : '+state+'</strong> <br>' +
                    '<strong><b>Total Cases :'+total_cases+'</striong><br>' +
                    '<strong><b>Deaths :'+Death+'</striong><br>' +
                    '<strong><b>Recoveries :'+Recov+'</striong><br>' +
                    '<strong><b>Active Cases :'+Active+'</striong>' ).add_to(india1)
india1
india1.save('Covid_Statistics.html')<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.16570378151260504, 'fraction_numerical': 0.04017857142857143, 'mean_word_length': 5.412457912457913, 'pattern_counts': {'":': 0, '<': 36, '<?xml version=': 0, '>': 36, 'https://': 1, 'lorem ipsum': 0, 'www.': 1, 'xml': 2}, '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': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '336109', 'license': 'MIT', 'n_tokens_mistral': 1452, 'n_tokens_neox': 1359, 'n_words': 245, 'path': 'COVID19_Cases .ipynb', 'repo_name': 'gargeesuresh/Visualizing-Covid-19-with-Folium', 'size': '3808'}