I have problem to analyse vincenty distance because the format is object
and have km
metrics in there, I want to analyse further. I want to convert vincenty distance to float
format
Here's the data
customer_id lat_free long_free lat_device long_device radius timestamp
7509 -6.283468 106.857636 -7.802388 110.368660 1264.000000 2017-12-14 21:18:40.327
7509 -6.283468 106.857636 -7.804296 110.367192 14.000000 2017-12-15 20:02:21.923
Here's my code
from geopy.distance import vincenty
df['Vincenty_distance'] = df.apply(lambda x: vincenty((x['lat_free'], x['long_free']), (x['lat_device'], x['long_device'])), axis = 1)
This is the result
customer_id lat_free long_free lat_device long_device radius timestamp Vincenty_distance
7509 -6.283468 106.857636 -7.802388 110.368660 1264.000000 2017-12-14 21:18:40.327 422.7123873310482 km
7509 -6.283468 106.857636 -7.804296 110.367192 14.000000 2017-12-15 20:02:21.923 422.64674499172787 km
I need to convert Vincenty_distance
to float