Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
# calculate the distance of each data point from # (Latitude, Longitude) = (58.4442, 9.3722)
def calculate_distance(x):
return harcdist((x['LATITUDE'],x['LONGITUDE']),(58.4442, 9.3722))
data['DISTANCE'] = data.progress_apply(calculate_distance,axis=1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment