import os
import pandas as pd
import numpy as np
import gmaps
import gmaps.datasets
gmaps.configure(api_key="YOUR_KEY_HERE")
CSV_PATH = os.path.join('data', 'geocodes_sample.csv')
df = pd.read_csv(CSV_PATH, low_memory=False)
mappable = df.drop(labels='ticket', axis=1)
mappable
latitude | longitude | |
---|---|---|
0 | 41.815545 | -87.690810 |
1 | 41.900575 | -87.696901 |
2 | 41.830372 | -87.681430 |
3 | 41.911148 | -87.638639 |
4 | 41.790842 | -87.622408 |
5 | 41.883677 | -87.693992 |
6 | 41.764226 | -87.580604 |
7 | 41.754561 | -87.555020 |
8 | 41.832746 | -87.620598 |
9 | 41.705333 | -87.614970 |
10 | 41.737111 | -87.575636 |
11 | 41.791378 | -87.732950 |
12 | 41.937368 | -87.695428 |
13 | 41.821426 | -87.627510 |
14 | 41.875338 | -87.661892 |
15 | 41.805031 | -87.664964 |
16 | 41.951915 | -87.716582 |
17 | 41.983038 | -87.773208 |
18 | 41.969704 | -87.767614 |
19 | 41.941820 | -87.652204 |
20 | 41.749949 | -87.684142 |
21 | 41.842529 | -87.707440 |
22 | 41.995671 | -87.793647 |
23 | 41.749019 | -87.624401 |
24 | 41.908607 | -87.687179 |
fig = gmaps.figure()
fig.add_layer(gmaps.heatmap_layer(mappable))
fig
Figure(layout=FigureLayout(height=u'420px'))