rosegeomap
In [9]:
def add_csv(csvfile):
import pandas as pd
import ipywidgets
import rosegeomap
from ipyleaflet import Marker
GasLeaks = pd.read_csv(csvfile)
GasLeaks = GasLeaks[['Date', 'Latitude', 'Longitude', 'Pipe Material']]
GasLeaks_map = rosegeomap.Map(zoom=1)
display(GasLeaks_map)
# plot earthquake locations using widget
def plot_GasLeaks(date):
g = GasLeaks.loc[GasLeaks['Date'] == date]
for (index, row) in g.iterrows():
marker = Marker(location=[row.loc['Latitude'], row.loc['Longitude']])
GasLeaks_map.add_layer(marker)
print(GasLeaks.loc[GasLeaks['Date'] == date])
plot_GasLeaks()
In [10]:
csvfile= "GasLeaks_data.csv"
add_csv(csvfile)
--------------------------------------------------------------------------- TypeError Traceback (most recent call last) <ipython-input-10-c52f379efef0> in <module> 1 csvfile= "GasLeaks_data.csv" ----> 2 add_csv(csvfile) <ipython-input-9-9144677d4242> in add_csv(csvfile) 18 print(GasLeaks.loc[GasLeaks['Date'] == date]) 19 ---> 20 plot_GasLeaks() TypeError: plot_GasLeaks() missing 1 required positional argument: 'date'
In [ ]:
(5,10),(4,5),()
Last update: 2021-05-05