I have a dataframe that contains x-y coordinates for a series of objects over time. I am trying to work out the total path length of each of these objects. I know the equation to work out the length of a line it
(√((x2-x1))^2+(y2-y1))) + (√((x3 - x2))^2+(y3-y2)))...
How would I work out the length of each individuals objects path from the data frame?
Thanks in advance!
I am unsure what exactly you mean by 'length of each individual object path'. If you want to add the distance between each 2 successive points in the dataframe, with the last point connecting to the first, use something like this:
If instead you would like to find a 2d convex hull (i.e. the minimum bounding polygon) for the set of 2d points, use scipy library for this. Try this code out: