1

I am following this lesson about Geocoding.

I have entered:

# Import necessary modules
import pandas as pd

# Filepath
fp = r"addresses.txt"

# Read the data
data = pd.read_csv(fp, sep=';')
data.head()

#geocoding tool
from geopandas.tools import geocode

#nominatim
geo = geocode(data['addr'], provider='nominatim')
geo.head(2)

but get this error:

AttributeError: module 'geopy.geocoders' has no attribute 'Yahoo'

What is the problem here?

Also, I have an API key for Nominatim, where would I put that? I defined the key:

key = "#########################"

then tried:

geo = geocode(data['addr'], provider='nominatim', key = key)

and

geo = geocode(data['addr'], provider='nominatim', **kwargs = key)

and they didn't work. I have tried to look for solutions online, but they were unclear about how to use the API key.

  • Look similar as this issue Geocoding error with geopandas and geopy. – Taras Nov 13 '18 at 12:26
  • Can you try installing GeoPandas from master and see if that solves your problem? – Taras Nov 13 '18 at 12:28
  • Thanks. Sorry I don't know what you mean by installing GeoPandas from master though. Can you explain that? Do you know what I should do with the API as well? – william3031 Nov 13 '18 at 19:57
  • I also tried the solution that you posted and that didn't solve my issue. – william3031 Nov 13 '18 at 20:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.