I am new to using pandas and I'm attempting to fix the last portion of my script. When calling the following function I am getting the error:
ValueError: Cannot set a DataFrame with multiple columns to the single column place_name
def get_place_name(latitude, longitude):
location = geolocator.reverse(f"{latitude}, {longitude}", exactly_one=True)
if location is None:
return None
else:
return location.address
This function is being called from here:
metadata_df = extract_metadata(dir_path)
print("[+] Metadata extracted from all image files")
print(metadata_df.columns)
geolocator = Nominatim(user_agent="exif_location")
metadata_df['place_name'] = metadata_df.apply(
lambda row: get_place_name(
row['gps_latitude'], row['gps_longitude']),
axis=1)
Any help or suggestions would be much appreciated :)