如何让gmaps热图显示在Jupyterlab?

2024-10-16 17:16:47 发布

您现在位置:Python中文网/ 问答频道 /正文

这是我使用过的代码,但我一直使用 Figure(layout=FigureLayout(height='420px'))作为输出。我如何得到实际的地图来显示

import gmaps

from config import gkey

gmaps.configure(api_key=gkey)

locations = file_df[["Latitude", "Longitude"]]
weight = file_df["Humidity"]

fig = gmaps.figure()

fig.add_layer(gmaps.heatmap_layer(locations, weights = weight, max_intensity = 100))
fig

Tags: 代码importlayerdf地图figfilefigure