A geographical analysis of COVID-19 using Folium library

Coronavirus disease (COVID-19) is an infectious disease caused by a newly discovered coronavirus.

Heatmaps

A heat map showing the effect of the novel coronavirus is shown here.

The data used here is available at: https://github.com/jojo96/COVID-Geographical-analysis

data = (r'C:\Users\admin\Desktop\Computational Neuroscience\statistical-gis-boundaries-london\corona-virus-report\covid_19_clean_complete.csv')
data = pd.read_csv(data)
df = []
for i in range(data.shape[0]):
if data['Date'][i]=='3/14/20':
df.append(data.iloc[i])
df = pd.DataFrame(df)
df
#the initial map is shown here
#im1 = cv.imread(r'C:\Users\admin\Desktop\Computational Neuroscience\statistical-gis-boundaries-london\m2.png')#
#img2 = im1[:,:,::-1]
plt.figure(figsize=(20,40))
plt.imshow(m2)
plt.title('folium.Map(location=[24, -12], zoom_start=2)')
plt.show()
#the Heatmap is shown here
#im1 = cv.imread(r'C:\Users\admin\Desktop\Computational Neuroscience\statistical-gis-boundaries-london\m1.png')
#img2 = im1[:,:,::-1]
#plt.figure(figsize=(20,40))
plt.imshow(m1)
plt.title('folium.Map(location=[24, -12], zoom_start=2)')
plt.show()

Additional (Coverting HTML to JPEG)

#path to the html file(which is to be converted to jpeg or png) 
temp_name = r'C:\Users\admin\Desktop\Computational Neuroscience\statistical-gis-boundaries-london\my_map.html'
options = webdriver.ChromeOptions()
options.add_argument('headless')
#download chromedriver.exe from https://chromedriver.chromium.org/downloads; check if the version of chromedriver
#matches the chrome browser version or is at least close
driver = webdriver.Chrome(executable_path=r"C:\Users\admin\Desktop\Computational Neuroscience\statistical-gis-boundaries-london/chromedriver.exe", chrome_options=options)
driver.get(temp_name)#path where you want to save the file save_name = r'C:\Users\admin\Desktop\Computational Neuroscience\statistical-gis-boundaries-london\my_map.html\1' + '.png'driver.save_screenshot(r'C:\Users\admin\Desktop\Computational Neuroscience\statistical-gis-boundaries-london\1.png')# this block of code converts all the html files in a folder to jpegs
import os
import glob
ind = 10
for file in glob.glob(r"C:\Users\admin\Desktop\Computational Neuroscience\statistical-gis-boundaries-london\heatsc/*.html"):
#print(file)
driver.get(file)
save_name = r'C:\Users\admin\Desktop\Computational Neuroscience\statistical-gis-boundaries-london\heatsimc\\' +str(ind)+ '.png'
driver.save_screenshot(save_name)
ind += 1

Code can be found at https://github.com/jojo96/COVID-Geographical-analysis

MSc Computer Vision, Graphics and Imaging, University College London