Gmaps没有显示在Spyder中 [英] Gmaps does not show up in Spyder

查看:100
本文介绍了Gmaps没有显示在Spyder中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在运行一个简单的示例:

I am running a simple example:

import gmaps
import gmaps.datasets

gmaps.configure(api_key="...")
earthquake_df = gmaps.datasets.load_dataset_as_df( 'earthquakes' ) 
locations = earthquake_df[[ 'latitude' , 'longitude' ]] 
weights = earthquake_df[ 'magnitude' ] 
fig = gmaps.figure() 
fig.add_layer(gmaps.heatmap_layer(locations, weights=weights)) 
fig

但没有看到热图,输出显示了这一点:

but instead of seeing a heatmap, the output shows this:

Figure(layout=FigureLayout(height='420px'))

我正在使用Spyder(Python 3.7)

I am using Spyder (Python 3.7)

推荐答案

(此处为 Spyder维护者),原因很简单:Spyder无法在其控制台上显示Web内容.Web内容是指只能在Web浏览器中呈现的内容.而 gmaps 包就是这种情况.

(Spyder maintainer here) The reason is very simple: Spyder can't show web content on its consoles. By web content I mean content that can only be rendered in a web browser. and that's the case for the gmaps package.

这篇关于Gmaps没有显示在Spyder中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆