I've been been trying the lat and long of dataframe using geocoder.
I managed to get the lat/long of distict city and save it into a file. However, I got an error when try to map the data to other data of city as Im not sure how to do so.
My code:
def func(a):
if a in data2['CITY']:
return data2['LATITUDE']
else:
return "0"
data["LATITUDE"] = data["CITY"].apply(lambda x: func(x))
lambda x: func(x)is redundant. Just usefunc. This is called eta-reduction btw.data2 = pd.to_excel(r'/'), I getAttributeError: module 'pandas' has no attribute 'to_excel'. Maybe you meantpd.read_excel()? But then you'd getIsADirectoryError: [Errno 21] Is a directory: '/'. Please provide a minimal reproducible example.print(deduplokasi.head().to_dict()andprint(data2.head().to_dict()?