我已经很长时间没有使用堆栈溢出了,所以如果它的格式或位置不正确,我深表歉意
下面的代码是我尝试使用folium和pandas时得到的: “ValueError:无法呈现缺少任何几何图形的对象”
我对python、pandas以及几乎所有API都是相当陌生的。我不明白如何纠正这个错误。现在是凌晨4点,也许我累了,但我想不出来。非常感谢您的帮助
listings = pd.read_csv('clean_listings.csv')
city_wards = pd.read_csv('jersey-city-ward-and-councilperson-map-2018.csv',
sep = ';', names = ['Geo Point', 'Ward'], error_bad_lines = False)
listings_map = folium.Map(location = [40.7153535,-74.1387714],
zoom_start = 12)
folium.Marker(
location = [40.719074, -74.050552],
popup = 'Welcome to Jersey City :)\n',
tooltip = 'Please click for more information',
).add_to(listings_map)
folium.Choropleth(geo_data = city_wards,
data = mapdata,
columns = ['neighbourhood', 'latitude', 'longitude'],
key_on = 'feature.mapdata.neigbourhood',
fill_color = 'PuRd', fill_opacity = 0.5, line_opacity = 0.2,
legend_name = 'Wards').add_to(listings_map)
listings_map
目前没有回答
相关问题 更多 >
编程相关推荐