When I try to look for London' Boroughs coordinates with GEOPY, some of the Boroughs are completely wrong (like Sutton appears in North London when is actually in the South). Also if the data frame where I am taking the information from is sorted by House_Price and not by Boroughs, it generates different coordinates (!??).
Any suggestions?
Thanks a lot!
def get_latilong(postal_code):
lati_long_coords = None
while(lati_long_coords is None):
g = geocoder.arcgis('{}, London, UK'.format(postal_code))
lati_long_coords = g.latlng
return lati_long_coords
get_latilong('Sutton')
Borough = df20['Borough']
coords = [ get_latilong(Borough) for Borough in Borough.tolist() ]
df20_coords = pd.DataFrame(coords, columns=['Latitude',
'Longitude'])
df20['Latitude'] = df20_coords['Latitude']
df20['Longitude'] = df20_coords['Longitude']