Skip to content
Advertisement

Two-point Euclidean distance from csv file

I want to calculate the distance between two points and label them. The problem is that the code doesn’t work on more than 1 line. When there is 1 row, the program shows me result which I want:

enter image description here

This is an error when there is more than 1 line : “cannot convert the series to <class ‘float’>”

This is my code:

JavaScript

The part that is commented out is when the x_end is greater than x_start etc.

This is my data frame

enter image description here

Advertisement

Answer

Try this

JavaScript
User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement