Folium地图未在Spyder中显示 [英] Folium map not displaying in Spyder

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

问题描述

标题说明了一切:我无法让Spyder用folium显示地图.

The title says it all : I can't get Spyder to display a map with folium.

这就是我得到的:

import folium
m = folium.Map(location=[45.5236, -122.6750])
m

没有错误(也没有地图),只是这样:

No error (and no map), just this :

< folium.folium.Map位于0xd03fcf8>

< folium.folium.Map at 0xd03fcf8 >

m.render() # No idea what .render() it's supposed to do, 
# but "render" sounds like maybe it could display the map, so I tried it.
# But it prints nothing

m.render

<绑定方法LegacyMap.render的< folium.folium.Map对象位于0x000000000D03FCF8>>

< bound method LegacyMap.render of < folium.folium.Map object at 0x000000000D03FCF8 > >

有什么主意吗?

谢谢

(注意:我尝试了,但没有成功)

(Note : I tried this, with no success)

推荐答案

如果您有地图m,则可以使用:

If you have a map m you could use:

m.save("mymap.html")

它将地图保存为html在您的工作目录中.您仍然必须在Chrome/IE中手动将其打开.这样的好处是,即使他/她的计算机上没有python,您也可以通过电子邮件将其发送给想要的任何人.

It saves your map in your working directory as html. You still have to open it manually in Chrome/IE. The advantage of this is that you can e-mail your map to anyone you want, even if he/she does not have python on his/her computer.

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

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