Python Beginner here. I have a python dataframe consisting of X,Y points that looks similar to this:
What I want to do is look at row 1 and find the distance between row 1 and row 2 and output the new distance between those 2 X,Y locations to a new column called "dist". Then do the same for row 2 and 3 and so on. My X,Y data is much larger than this, but this is the basis for my problem. Ultimately the data stops, each point is making up a larger polyline so the end point will have a zero distance.
I'm aware I can use geopy, numpy, and pyproj as few. I initially tried haversine distance but was having issues importing the python module. I'm not sure how to approach this problem using those modules, do I need a search cursor and apply that to each row? So, If I have a polyline with nodes, calculating the distances between each of those nodes. These are coordinates in real locations on earth, so not a cartesian coordinate system, if you will