【问题标题】:Bing used as a GeocodeBing 用作地理编码
【发布时间】:2022-06-21 16:57:46
【问题描述】:

尝试将 Bing 用作地理编码器,已成功完成,但尝试执行批处理时,仅显示一个结果。代码如下:

import geocoder
g = geocoder.bing([df['Address']], method='batch', key='XXXX')
for result in g:
print(result.latlng)

使用的 df 仅包含来自 Cheesecake Factory 的地址作为示例(仅 4 个),并且位于名为“Address”的列中。它正确显示了 df 中的第一个。

enter image description here

【问题讨论】:

  • 这是什么语言?蟒蛇?

标签: python bing geocode


【解决方案1】:

这对我有用:

from geopy import Bing
geocoder = Bing(api_key='insert key here')
df['bing_locations'] = df['Address'].apply(geocoder.geocode)
df

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2011-01-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-05-09
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多