Python 蟒蛇';数据帧';对象不可调用-错误原因
早上好,我的df(df_part3)在上面:Python 蟒蛇';数据帧';对象不可调用-错误原因,python,for-loop,Python,For Loop,早上好,我的df(df_part3)在上面: Postal Code Borough Neighbourhood Latitude Longitude 0 M5A Downtown Toronto Regent Park, Harbourfront 43.654260 -79.360636 1 M7A Downtown Toronto Queen's Park, Ontario Provincial Government 43.662301 -79.38
Postal Code Borough Neighbourhood Latitude Longitude
0 M5A Downtown Toronto Regent Park, Harbourfront 43.654260 -79.360636
1 M7A Downtown Toronto Queen's Park, Ontario Provincial Government 43.662301 -79.389494
2 M5B Downtown Toronto Garden District, Ryerson 43.657162 -79.378937
3 M5C Downtown Toronto St. James Town 43.651494 -79.375418
4 M4E East Toronto The Beaches 43.676357 -79.293031
... ... ... ... ... ...
34 M5W Downtown Toronto Stn A PO Boxes 43.646435 -79.374846
35 M4X Downtown Toronto St. James Town, Cabbagetown 43.667967 -79.367675
36 M5X Downtown Toronto First Canadian Place, Underground city 43.648429 -79.382280
37 M4Y Downtown Toronto Church and Wellesley 43.665860 -79.383160
38 M7Y East Toronto Business reply mail Processing Centre, South C... 43.662744 -79.321558
我的代码在这里:
map_toronto = folium.Map(location=[latitude, longitude], zoom_start=11)
# add markers to map
for lat, lng, label in zip(df_part3['Latitude'], df_part3['Longitude'], df_part3['Neighbourhood']):
label = folium.Popup(label, parse_html=True)
folium.CircleMarker(
[lat, lng],
radius=5,
popup=label,
color='blue',
fill=True,
fill_color='#3186cc',
fill_opacity=0.7,
parse_html=False).add_to(map_toronto)
map_toronto
但当我运行它时,我得到:
TypeError:“DataFrame”对象不可调用---->5对于lat、lng,拉链标签(df_Part 3['纬度]、df_Part 3['经度]、df_Part 3['邻里]):
有人知道如何帮助我吗?df_part3['Latitude']将是一个数据帧对象。试着转换成一个类似于列表的列表(df_part3['Latitude']),它完全是这样的。在这条线路的某个地方,您可能损坏了df_part3