In [1]:
URL = 'https://data.seattle.gov/api/views/65db-xm6k/rows.csv?accessType=DOWNLOAD'

In [2]:
from urllib.request import urlretrieve
urlretrieve(URL, 'Fremont.csv')


Out[2]:
('Fremont.csv', <http.client.HTTPMessage at 0x10b2253c8>)

In [3]:
!head Fremont.csv


Date,Fremont Bridge West Sidewalk,Fremont Bridge East Sidewalk
10/03/2012 12:00:00 AM,4,9
10/03/2012 01:00:00 AM,4,6
10/03/2012 02:00:00 AM,1,1
10/03/2012 03:00:00 AM,2,3
10/03/2012 04:00:00 AM,6,1
10/03/2012 05:00:00 AM,21,10
10/03/2012 06:00:00 AM,105,50
10/03/2012 07:00:00 AM,257,95
10/03/2012 08:00:00 AM,291,146

In [4]:
import pandas as pd
df = pd.read_csv('Fremont.csv', index_col='Date', parse_dates=True)
df.head()


Out[4]:
Fremont Bridge West Sidewalk Fremont Bridge East Sidewalk
Date
2012-10-03 00:00:00 4.0 9.0
2012-10-03 01:00:00 4.0 6.0
2012-10-03 02:00:00 1.0 1.0
2012-10-03 03:00:00 2.0 3.0
2012-10-03 04:00:00 6.0 1.0

In [5]:
%matplotlib inline

In [6]:
df.info()


<class 'pandas.core.frame.DataFrame'>
DatetimeIndex: 38640 entries, 2012-10-03 00:00:00 to 2017-02-28 23:00:00
Data columns (total 2 columns):
Fremont Bridge West Sidewalk    38633 non-null float64
Fremont Bridge East Sidewalk    38633 non-null float64
dtypes: float64(2)
memory usage: 905.6 KB

In [7]:
df.plot()


Out[7]:
<matplotlib.axes._subplots.AxesSubplot at 0x1143a4eb8>

In [8]:
df.resample('W').sum().plot();