Created
March 11, 2020 21:57
-
-
Save sergiolucero/e0a6dd13494f139acd968e231906aef2 to your computer and use it in GitHub Desktop.
plotting COVID advance
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import folium, pandas as pd | |
from folium.plugins import MarkerCluster | |
pdf = pd.read_json('https://tinyurl.com/covid19-github') | |
pdf = pdf[pdf.data==pdf.data.max()] | |
pdf = pdf[pdf.totale_casi>0] | |
location = pdf.describe()[['lat','long']].loc['50%'].values | |
fm = folium.Map(location=location, zoom_start=6, tile='stamentoner', | |
width=800, height=600) | |
mc = MarkerCluster() | |
for row in pdf.itertuples(): | |
mc.add_child(folium.Marker(location=[row.lat, row.long], | |
popup=row.denominazione_provincia)) | |
mc.add_to(fm) | |
fm |
Author
sergiolucero
commented
Mar 11, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment