I have a dataframe with location column which contains lat,long location as follows
deviceid location
1102ADb75 [12.9404578177, 77.5548244743]
How to get the distance between consecutive rows using geopy's vicenty function? I tried following code
from geopy.distance import vincenty
vincenty(df['location'].shift(-1), df['location']).miles
It returns following error - TypeError: __new__() takes at most 4 arguments (5 given)
EDIT - where df is a Pandas dataframe containing deviceId & Location columns as shown above Also
print type(df)
class 'pandas.core.frame.DataFrame'
Based on geopy's github you should pass two tuples to the
vincenty
function:EDIT: