1

I am trying to plot some data on a Map using Ipyleaflet on Databricks community Notebook I got all the points in a Panda DataFrame but when I pass column to the map and try to save it in a file I got an error

from ipyleaflet import Map,Heatmap
from IPython.display import HTML
from random import uniform
from ipyleaflet import Map, basemaps, basemap_to_tiles
latitudes = trips['start_station_latitude']
longitudes = trips['start_station_longitude']
intensities = trips['count']



m = Map(center=[0, 0], zoom=2)
locations = [
    latitudes.to_json(), longitudes.to_json(), intensities.to_json()
]
heat = Heatmap(locations=locations, radius=20, blur=10)
m.add_layer(heat)

# Change some attributes of the heatmap
heat.radius = 30
heat.blur = 50
heat.max = 0.5
heat.gradient = {0.4: 'red', 0.6: 'yellow', 0.7: 'lime', 0.8: 'cyan', 1.0: 'blue'}

m
m.save("test.html")

HTML(filename="test.html")

When I try to execute I get this error :

enter image description here

Does anyone have any idea about this error ? And is there another method method to plot this map without saving it , I tried to install to jupyter extension but I didn't found how to do it in Databricks Community Platform Thank you everyone

DJAMEL DAHMANE
  • 404
  • 4
  • 15

0 Answers0