How can I calculate distance between two points characterized by latitudes and longitudes?
Data · 30 May 2020, 13:15 · 7

Hey, everybody, the problem is I want to computer distance between two points, but I am not understand how do you do it in dataset. There are serving distance and delivery distance that were calculated somehow. Well, how was it done?

Discussion 7 answers

You can use vincenty distance formulas / python library or haversine for the same.

30 May 2020, 13:23
Upvotes 0

I tried. It doesn't work because of the unreal latitude and longitude

Hey it can cause if there are na's or not bounded latitude / longitude, better if you check your data I mean presence of na and

I guess you didn't get my question. In orders.csv there is "deliverydistance" and I wanna know algorithm of getting this distance

User avatar
MICADEE
LAHASCOM

Yea @psueduname

I got your point there. There's presence of NAN'S especially when I finished calculating my Manhattan Distance ( which I preferred to haversine distance).

My question is:

How can we deal with these NAN'S? Should we leave it , remove it or treat them?

Convert lat and long to radians and use geopy (import geopy.distance)

30 May 2020, 13:46
Upvotes 0