python - Pythons 'DataFrame' 对象不可调用 - FOR ERROR
问题描述
早上好,我的 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.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 for lat, lng, label in zip(df_part3['Latitude'], df_part3['Longitude'], df_part3['Neighbourhood']):
有谁知道如何帮助我?
解决方案
推荐阅读
- php - 用 PHP 显示日文字符
- azure - 有没有办法在 Log Analytics 中查询 Azure 安全建议 (ASC)
- python - 在 Python 中使用 psycopg2 将 postgres 表导出到 csv
- android - 在 onNext 之前对 observable 中的每个项目执行非转换操作
- python - 将多行组合成一行一列Python
- c++ - 为什么 while (true) 会影响它之前的代码?
- mongodb - 初始管道关闭后使用光标的问题 – MongoDB
- neo4j - 使用 APOC 导入 JSON 数据
- java - 动态创建谓词
- r - 将子分组应用于 R 中的子组