Skip to content

Instantly share code, notes, and snippets.

@lakshay-arora
Created August 19, 2019 13:41
Show Gist options
  • Save lakshay-arora/097197aa89903d0730f8cbca55309a53 to your computer and use it in GitHub Desktop.
Save lakshay-arora/097197aa89903d0730f8cbca55309a53 to your computer and use it in GitHub Desktop.
# 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