In [12]:
import matplotlib
%matplotlib inline
import os
import pandas
import bokeh
In [73]:
data_url = 'http://www.pedestrian.melbourne.vic.gov.au/datadownload/September_2014.csv'
In [75]:
df = pandas.read_csv(data_url, parse_dates='Date')
df.head()
Out[75]:
Date Hour State Library Collins Place (South) Collins Place (North) Flagstaff Station Melbourne Central Town Hall (West) Bourke Street Mall (North) Bourke Street Mall (South) ... Spencer St-Collins St (South) Bourke St-Russell St (West) Convention/Exhibition Centre Chinatown-Swanston St (North) Chinatown-Lt Bourke St (South) QV Market-Peel St Vic Arts Centre Lonsdale St (South) Lygon St (West) Flinders St-Spring St (West)
0 1/09/2014 0 54 6 4 21 136 92 40 23 ... 18 91 13 83 26 8 23 151 42 6
1 1/09/2014 0 60 10 4 21 153 109 43 31 ... 24 127 18 104 27 9 28 178 58 6
2 1/09/2014 1 20 3 4 8 56 38 13 22 ... 1 75 20 29 26 1 4 89 33 0
3 1/09/2014 1 27 5 4 9 69 53 14 31 ... 2 88 20 32 29 1 5 123 67 1
4 1/09/2014 2 21 9 8 5 23 24 2 19 ... 11 43 4 18 5 1 9 61 6 0

5 rows × 33 columns

In [78]:
# Why are there two entries for each hour? Let's just take the first...
parts = df[['Date', 'Hour', 'State Library']].drop_duplicates(['Date', 'Hour'])
In [79]:
pdf = parts.pivot(columns='Date', index='Hour', values='State Library')
In [80]:
from bokeh.plotting import figure, show, output_notebook
from bokeh.charts import HeatMap
output_notebook()