I'm new to Python and using Pandas dataframes.
I'm trying to create a new column in a dataframe of country names composed from latitude and longitude records via reverse geocoding, but I'm having some troubles.
This works perfectly, and returns name of country for one row:
res = Geocoder.reverse_geocode(df['latitude'][0], df['longitude'][0])
print(res.country)
However, when I try to get country for all columns it won't work:
df['country'] = (Geocoder.reverse_geocode(df['latitude'], df['longitude'])).country
"KeyError = 12"
I have not found anything online with a solution I can get to work. Any suggestions?