import pandas as pd # working with data frames, a versatile tabular data structure
from ipywidgets import Layout # display interactive widgets in notebook
from ipyleaflet import Map, Marker, MarkerCluster # interactive mapping
df = pd.read_csv('data/processed.csv')
ldf = df[['Guest Location', 'guest_lat', 'guest_lon']].dropna(how='any')
guest_markers = []
for lat, lon, loc in zip(ldf.guest_lat, ldf.guest_lon, ldf['Guest Location']):
marker = Marker(location=(lat,lon), title=loc)
guest_markers.append(marker)
ms = guest_markers[:1050] + guest_markers[1450:]
m = Map(center=(55.68,12.57), zoom=8, layout=Layout(width='960px', height='768px'))
marker_cluster = MarkerCluster(
markers=tuple(ms)
)
m.add_layer(marker_cluster);
m
Map(center=[55.68, 12.57], controls=(ZoomControl(options=['position', 'zoom_in_text', 'zoom_in_title', 'zoom_o…
ldf = df[['Rental Anon', 'property_lat', 'property_lon']].drop_duplicates().dropna(how='any')
property_markers = [Marker(location=point) for point in list(zip(ldf.property_lat, ldf.property_lon))]
m = Map(center=(55.68,12.57), zoom=13)
marker_cluster = MarkerCluster(
markers=tuple(property_markers)
)
m.add_layer(marker_cluster);
m
Map(center=[55.68, 12.57], controls=(ZoomControl(options=['position', 'zoom_in_text', 'zoom_in_title', 'zoom_o…