I have a Pandas
dataframe with ~20k rows, and I am trying to geocode by address column into lat/long coordinates.
How do I use time.sleep()
or maybe other function to stop OSM Nominatim from Too Many Requests 429 error
that I am getting now?
Here's the code I use for this:
from geopy.geocoders import Nominatim
from geopy.distance import vincenty
geolocator = Nominatim()
df['coord'] = df['address'].apply(geolocator.geocode).apply(lambda x: (x.latitude, x.longitude))
df.head()
Thanks in advance!