parkrun goes global

Posted on Fri 01 September 2017 in Projects

In [1]:
import pandas as pd
import gmaps
import numpy as np
In [2]:
data = pd.read_csv('../images/geo.txt', sep = "=", header=None)
In [3]:
df = data.drop([0,1,2,3,4,5], axis=1)
In [4]:
df.columns = ["lat", "lon"]
In [5]:
#ignore
# df.head()
In [6]:
df['lat'] = df['lat'].astype(str).str[:-2].astype(np.float)
df['lon'] = df['lon'].astype(str).str[:-2].astype(np.float)
In [7]:
df.head()
Out[7]:
lat lon
0 57.166775 -2.079061
1 52.414546 -4.080401
2 51.667957 -1.277429
3 -20.267153 148.711122
4 54.564972 -1.231788
In [8]:
#ignore
gmaps.configure(api_key="AIzaSyCWGmXSL75gi_IMA3ViVRQ_597I4Gtn7VE")
In [9]:
fig = gmaps.figure(center=(12.5, 22.0), zoom_level=2)
parkruns = gmaps.symbol_layer(df, scale = 2)
fig.add_layer(parkruns)
In [11]:
#ignore
# fig