Skip to content

Instantly share code, notes, and snippets.

@sergiolucero
Created March 11, 2020 21:57
Show Gist options
  • Save sergiolucero/e0a6dd13494f139acd968e231906aef2 to your computer and use it in GitHub Desktop.
Save sergiolucero/e0a6dd13494f139acd968e231906aef2 to your computer and use it in GitHub Desktop.
plotting COVID advance
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
@sergiolucero
Copy link
Author

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment