Présentation :
L'intensité du vent est mesurée avec l'échelle de Saffir-Simpson :
|
|
En coup de vent...
Création de la table T liée au fichier tempetes.csv :
import pandas as pa
import pylab as pl
pl.style.use('seaborn')
T = pa.read_csv('ouragans.csv')
T.head()
Représentation avec Folium
import folium
from math import sqrt
palette_couleurs = { 0 : 'green',
1 : 'blue',
2 : 'pink',
3 : 'yellow',
4 : 'orange',
5 : 'red'}
D = T.query('nom == "IVAN" and annee == 2004')
D.head()
carte = folium.Map(location=[30,-60],tiles='Stamen Toner', zoom_start=3)
Table = D[['lat','lon','vent','cat','mois','jour','heure']]
for i,(lat,long,vent,cat,m,j,h) in Table.iterrows():
texte = '<div>{v} km/h<br>date : {h}/{j}/{m}</div>'.format(v=vent,h=int(h),j=int(j),m=int(m))
folium.CircleMarker(location=(lat,long),
fill = True,
fill_color = palette_couleurs[cat],
fill_opacity = 0.5,
color = 'black',
popup = folium.Popup(texte,max_width = '300'),
radius = sqrt(vent)
).add_to(carte)
carte
carte.save('ivan_2004.html')
Fini ...
from IPython.core.display import HTML
htm = open("style_css.txt").read()
HTML(htm)