尝试使用Folium显示一个地图,我得到了下面的类型错误消息。这就是我的代码单元格中的内容。
import folium
from folium.plugins import HeatMap
lat = df.dropna()['BEGIN_LAT']
#lat.head()
lon = df.dropna()['BEGIN_LON']
locations = list(zip(lat, lon))
lon_lat = (37.09024, -95.712891)
map = folium.map(location = lon_lat, zoom_start = 7, tiles ="OpenStreetMap")
map=folium_hmap
heat_map = HeatMap(locations)
heat_map.add_to(map)
map我收到这个错误消息:
TypeError Traceback (most recent call last)
<ipython-input-53-fa79a3781f76> in <module>
----> 1 map = folium.map(location = lon_lat, zoom_start = 7, tiles ="OpenStreetMap")
2 map=folium_hmap
3 heat_map = HeatMap(locations)
4 heat_map.add_to(map)
5 display(map)
TypeError: 'module' object is not callable发布于 2021-06-23 20:25:45
您有一个拼写错误:它是大写为M的folium.Map()。您还需要删除行map=folium_hmap
https://stackoverflow.com/questions/68091712
复制相似问题