I would like to compute the average euclidean distance in a 2D dataset (xCoords , yCoords) but only between neighbouring points.
As an example:
xCoords = [[16.8742 10.7265 30.0538 10.4524 12.6483 15.5349 10.2094 28.6425 9.2882]]
yCoords = [[14.5835 6.0766 12.7006 4.3638 5.0318 14.2657 8.3131 15.8346 6.1746]]
I want to find the euclidean distance between the points but only of those which are adjacent points to each other. Is there maybe a numpy, scipy or sklearn function (or some other) for my task?
EDIT:
As an illustration:
What I want:
What I don't want:
I don't want to compute the euclidean distance from every single data point to ALL other ones.

