In [107]:
import pandas as pd, numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
from jupyterthemes import jtplot
jtplot.style('solarized-light')

In [71]:
df=pd.read_html('http://www.aoml.noaa.gov/hrd/tcfaq/E11.html')

In [72]:
df=df[3].dropna()[:-2].T.set_index(0).T.set_index('Year')
df.head()


Out[72]:
NamedStorms Hurricanes MajorHurricanes ACE
Year
1851 6 3 1 36
1852 5 5 1 73
1853 8 4 2 76
1854 5 3 1 31
1855 5 4 1 18

In [73]:
dg=pd.read_html('http://www.aoml.noaa.gov/hrd/hurdat/UShurrs_detailed.html')

In [74]:
dg=dg[2].dropna().T.set_index(1).T

In [75]:
ind=[i.replace('$','').replace('*','').replace('#','').replace('%','').replace('&','') for i in np.array(dg[dg.columns[0]])]
ind=[pd.to_datetime(i[i.find('-')+1:]) for i in ind]

In [76]:
dg.index=ind

In [84]:
dg


Out[84]:
1 #/Date Time Latitude Longitude Max Winds (kt) SS HWS RMWnm CentralPressure(mb) OCI (mb) Size (nm) States Affected Storm Names
1851-06-25 00:00:00 1-6/25/1851$ 2100Z 28.2N 96.8W 80 1 --- (974) ---- --- BTX1 ---------------
1851-08-23 00:00:00 4-8/23/1851$ 2100Z 30.1N 85.7W 100 3 --- (950) ---- --- AFL3,IGA1 "Great Middle Florida"
1852-08-22 00:00:00 1-8/22/1852$ 1200Z 23.8N 81.1W 90 2 --- (970) ---- --- BFL2 ---------------
1852-08-26 00:00:00 1-8/26/1852 0600Z 30.2N 88.6W 100 3 10 961 ---- --- AL3,MS3,LA2,AFL1 "Great Mobile"
1852-09-12 00:00:00 3-9/12/1852$ 0000Z 28.0N 82.8W 70 1 --- (982) ---- --- BFL1 ---------------
1852-10-09 00:00:00 5-10/9/1852$ 2100Z 29.9N 84.4W 90 2 --- (965) ---- --- AFL2,IGA1 "Middle Florida"
1853-10-21 00:00:00 8-10/21/1853* 0600Z 30.9N 80.9W 70 1 --- (965) ---- --- GA1 ---------------
1854-06-26 00:00:00 1-6/26/1854$ 1200Z 26.2N 97.0W 70 1 --- (982) ---- --- ATX1 ---------------
1854-09-08 00:00:00 3-9/8/1854 2000Z 31.7N 81.1W 100 3 40 950 ---- --- GA3,SC2,DFL1 "Great Carolina"
1854-09-18 00:00:00 4-9/18/1854 2100Z 28.9N 95.3W 90 2 --- (965) ---- --- BTX2 "Matagorda"
1855-09-16 00:00:00 6-9/16/1855$ 0300Z 29.2N 89.5W 110 3 --- (945) ---- --- LA3,MS3 "Middle Gulf Shore"
1856-08-10 00:00:00 1-8/10/1856$ 1800Z 29.2N 91.1W 130 4 10 934 ---- --- LA4 "Last Island"
1856-08-31 00:00:00 5-8/31/1856$ 0600Z 30.2N 85.9W 90 2 --- (965) ---- --- AFL2,IAL1,IGA1 "Southeastern States"
1857-09-13 00:00:00 2-9/13/1857 0000Z 33.9N 78.0W 90 2 --- 961 ---- --- NC2 ---------------
1858-09-16 00:00:00 3-9/16/1858 1700Z 40.9N 72.2W 80 1 45 (976) ---- --- NY1 "New England"
1858-09-16 00:00:00 3-9/16/1858 1800Z 41.4N 72.0W 70 1 45 979 ---- --- CT1,RI1,MA1 "New England"
1859-09-16 00:00:00 5-9/16/1859 0000Z 30.3N 88.1W 70 1 --- (982) ---- --- AL1,AFL1 ---------------
1859-10-28 00:00:00 8-10/28/1859$ 1800Z 27.7N 82.8W 80 1 --- (974) ---- --- BFL2,CFL1 ---------------
1860-08-11 00:00:00 1-8/11/1860$ 2000Z 29.2N 90.0W 110 3 --- (945) ---- --- LA3,MS3,AL2 ---------------
1860-09-15 00:00:00 4-9/15/1860$ 0400Z 29.3N 89.6W 90 2 --- (965) ---- --- LA2,MS2,AL1 ---------------
1860-10-02 00:00:00 6-10/2/1860$ 1700Z 29.5N 91.4W 90 2 --- (965) ---- --- LA2 ---------------
1861-08-16 00:00:00 2-8/16/1861$* 0000Z 24.2N 82.0W 70 1 --- (978) ---- --- BFL1 "Key West"
1861-09-27 00:00:00 5-9/27/1861 1700Z 34.5N 77.4W 70 1 --- (985) ---- --- NC1 "Equinoctial"
1861-11-02 00:00:00 8-11/2/1861 1000Z 34.7N 76.6W 70 1 --- (985) ---- --- NC1 "Expedition"
1865-09-13 00:00:00 4-9/13/1865$ 2100Z 29.8N 93.4W 90 2 --- (965) ---- --- LA2,CTX1 "Sabine River"
1865-10-23 00:00:00 7-10/23/1865$ 1000Z 24.6N 81.7W 90 2 --- (969) ---- --- BFL2 ---------------
1865-10-23 00:00:00 7-10/23/1865$ 1400Z 25.4N 81.1W 90 2 --- (969) ---- --- BFL2,CFL1 ---------------
1866-07-15 00:00:00 1-7/15/1866 1200Z 28.5N 96.5W 90 2 --- (965) ---- --- BTX2 ---------------
1867-06-22 00:00:00 1-6/22/1867 1400Z 32.9N 79.7W 70 1 --- (985) ---- --- SC1 ---------------
1867-10-02 00:00:00 7-10/2/1867$# 1500Z 25.4N 97.1W 70 1 --- (969) ---- --- ATX1 "Galveston"
... ... ... ... ... ... ... ... ... ... ... ... ...
2004-08-03 1-8/3/2004* 1700Z 35.1N 75.4W 70 1 --- 972 ---- --- NC1 Alex
2004-08-13 3-8/13/2004 1945Z 26.6N 82.2W 130 4 --- 941 ---- --- BFL4 Charley
2004-08-13 3-8/13/2004 2045Z 26.9N 82.1W 125 4 --- 942 ---- --- BFL4,CFL1,DFL1 Charley
2004-08-14 3-8/14/2004 1400Z 33.0N 79.4W 70 1 --- 992 ---- --- SC1 Charley
2004-08-14 3-8/14/2004 1600Z 33.8N 78.7W 65 1 --- 997 ---- --- SC1 Charley
2004-09-05 6-9/5/2004 0430Z 27.2N 80.2W 90 2 --- 960 ---- --- CFL2,BFL1 Frances
2004-08-29 7-8/29/2004 1400Z 33.0N 79.6W 65 1 --- 985 ---- --- SC1 Gaston
2004-09-16 9-9/16/2004 0650Z 30.2N 87.9W 105 3 --- 946 ---- --- AL3,AFL3 Ivan
2004-09-26 10-9/26/2004 0400Z 27.2N 80.2W 105 3 --- 950 ---- --- CFL3,BFL1,AFL1 Jeanne
2005-07-06 3-7/6/2005 0300Z 29.2N 90.1W 65 1 --- 991 ---- --- LA1 Cindy
2005-07-10 4-7/10/2005 1930Z 30.4N 87.1W 105 3 --- 946 ---- --- AFL3,IAL1 Dennis
2005-08-25 11-8/25/2005 2230Z 26.0N 80.1W 70 1 --- 984 ---- --- CFL1,BFL1 Katrina
2005-08-29 11-8/29/2005 1110Z 29.3N 89.6W 110 3 --- 920 ---- --- LA3 Katrina
2005-08-29 11-8/29/2005 1445Z 30.2N 89.6W 105 3 --- 928 ---- --- LA3,MS3,AL1 Katrina
2005-09-15 15-9/15/2005* 0600Z 34.5N 76.3W 65 1 --- 982 ---- --- NC1 Ophelia
2005-09-24 17-9/24/2005 0740Z 29.7N 93.7W 100 3 --- 937 ---- --- LA3,CTX2 Rita
2005-10-24 21-10/24/2005 1030Z 25.9N 81.7W 105 3 --- 950 ---- --- BFL3,CFL2 Wilma
2007-09-13 8-9/13/2007 0700Z 29.6N 94.3W 80 1 --- 985 ---- --- CTX1,LA1 Humberto
2008-07-23 4-7/23/2008 1820Z 26.4N 97.2W 75 1 --- 967 ---- --- ATX1 Dolly
2008-07-23 4-7/23/2008 2000Z 26.4N 97.4W 70 1 --- 967 ---- --- ATX1 Dolly
2008-09-01 7-9/1/2008 1500Z 29.2N 90.7W 90 2 --- 954 ---- --- LA2 Gustav
2008-09-13 9-9/13/2008 0700Z 29.3N 94.7W 95 2 --- 950 ---- --- CTX2,LA1 Ike
2011-08-27 9-8/27/2011 1200Z 34.7N 76.6W 75 1 --- 952 ---- --- NC1 Irene
2012-08-29 9-8/29/2012 0000Z 28.9N 89.4W 70 1 --- 967 ---- --- LA1 Isaac
2012-08-29 9-8/29/2012 0800Z 29.2N 90.2W 70 1 --- 966 ---- --- LA1 Isaac
2012-10-29 18-10/29/2012% 2035Z 38.7N 73.9W 65 1 --- 942 ---- --- NY1 Sandy
2014-07-04 1-7/4/2014 0315Z 34.7N 76.6W 85 2 --- 973 ---- --- NC2 Arthur
2014-07-04 1-7/4/2014 0800Z 35.8N 75.5W 85 2 --- 973 ---- --- NC2 Arthur
2016-09-02 11-9/2/2016 0530Z 30.1N 84.1W 70 1 --- 981 ---- --- AFL1 Hermine
2016-10-08 14-10/8/2016* 1500Z 33.0N 79.5W 85 2 --- 963 ---- --- DFL2, GA1, SC1, NC1 Matthew

339 rows × 12 columns


In [108]:
dg['Max Winds (kt)'].astype('float').hist()


Out[108]:
<matplotlib.axes._subplots.AxesSubplot at 0xce8c5f8>

In [109]:
dg['Max Winds (kt)'].astype('float').rolling(100).mean(center=False).plot()


Out[109]:
<matplotlib.axes._subplots.AxesSubplot at 0xbb81ba8>

In [117]:
dg['lat']=[float(i.replace('N','')) for i in dg['Latitude'].values]

In [145]:
plt.scatter(dg.index,dg['lat'],c='grey')
f=dg['lat'].rolling(60)
plt.fill_between(dg.index,f.mean()-f.std(),f.mean()+f.std(),alpha=0.3,color='royalblue')
plt.fill_between(dg.index,f.mean()-f.std()/2.0,f.mean()+f.std()/2.0,alpha=0.5,color='royalblue')
plt.plot(dg.index,f.mean(),c='blue')


Out[145]:
[<matplotlib.lines.Line2D at 0x1581a208>]

In [186]:
dc=pd.read_html('http://www.wpc.ncep.noaa.gov/tropical/rain/tcmaxima.html')

In [187]:
dc=dc[0].drop(2,axis=1)

In [188]:
from dateutil import parser

In [189]:
ind=[i[i.find('(')+1:i.find(')')] for i in dc[0][1:]]
ind=[parser.parse(i[i.find('-')+1:]) for i in ind]

In [194]:
val=[float(i[:i.find(' ')]) for i in dc[1][1:]]

In [215]:
fig,ax=plt.subplots(1,1)
pd.DataFrame(val,index=ind).rolling(20).mean().plot(ax=ax)
pd.DataFrame(val,index=ind).rolling(50).mean().plot(ax=ax)
pd.DataFrame(val,index=ind).rolling(100).mean().plot(ax=ax)
pd.DataFrame(val,index=ind).rolling(150).mean().plot(ax=ax)


Out[215]:
<matplotlib.axes._subplots.AxesSubplot at 0x1837dbe0>

In [216]:
w=pd.read_html('https://en.wikipedia.org/wiki/List_of_the_most_intense_tropical_cyclones')

In [227]:
n_atl=w[0].T.set_index(0).T.dropna()

In [228]:
e_pac=w[1].T.set_index(0).T.dropna()

In [229]:
nw_pac=w[2].T.set_index(0).T.dropna()

In [230]:
n_ind=w[3].T.set_index(0).T.dropna()

In [231]:
sw_ind=w[4].T.set_index(0).T.dropna()

In [233]:
aus=w[5].T.set_index(0).T.dropna()

In [235]:
s_pac=w[6].T.set_index(0).T.dropna()

In [238]:
s_atl=w[7].T.set_index(0).T.dropna()

In [240]:
df=[n_atl,s_atl,e_pac,nw_pac,n_ind,sw_ind,aus,s_pac]u'\u2660'u'\xa0'

In [337]:
data=[]
for j in range(7):
    for i in df[j].T.iteritems():
        print i[1][0].replace('"',''),i[1][3][i[1][3].find('hPa')-4:i[1][3].find('hPa')].strip(),
        if u'\u2013' in i[1][1]:
            print i[1][1][:i[1][1].find(u'\u2013')],
        elif u'-' in i[1][1]:
            print i[1][1][:i[1][1].find(u'-')],
        else: print i[1][1],
        k=i[1][2][i[1][2].find('!')+1:i[1][2][i[1][2].find('!')+1:].strip().find(' ')].strip()
        if u'\u2660' in k:
            print k[k.find(u'\u2660')+1:k.find(u'\xa0')]
        else: print k


Mahina 914 1899 205
Joan 915 1975 230
Amy 915 1979 230
Orson 904 1988 250
Graham 915 1991 230
Theodore 910 1993 200
Vance 910 1998 215
Gwenda 900 1998 220
Chris 915 2001 205
Inigo 900 2002 240
Fay 910 2003 215
Floyd 916 2005 195
Glenda 910 2005 205
Monica 916 2005 250
George 902 2006 205
Ita 922 2013 220
Ernie 922 2016 220