I am trying to loop through a dataframe of latitudes and longitudes to find the postcodes for each row, using geocoder (method: reverse), however, I get the error "TypeError: cannot convert the series to"
This is my code
import pandas as pd
df = pd.read_csv("Bunnings Co-Ordinates.csv")
import geocoder
for Store in df["Store"]:
g = geocoder.google([df["Latitude"], df["Longitude"]], method='reverse', key="API_KEY")
print(g.postal)
and I get the error "TypeError: cannot convert the series to".
I originally tried to loop through a list of co-ordinates using this code;
import geocoder
coordinates = [-27.59041, 153.02848, -34.93522, 138.53637]
latitudes = [-27.59041, -34.93522]
longitudes = [153.02848, 138.53637]
for coordinate in coordinates:
g = geocoder.google([latitudes, longitudes], method='reverse', key="API_KEY")
print(g.postal)
and I got this error: "TypeError: float() argument must be a string or a number, not 'list'"