pythonbinggeocode

Bing used as a Geocode


Try to use Bing as a Geocoder, have done it successfully but when trying to do a batch, only displays one result. Here is the code:

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

The df used only contains addresses from Cheesecake Factory as an example (only 4) and is in a column called "Address". It correctly displays the first one in the df.

enter image description here


Solution

  • This worked for me:

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