Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

Calculate Euclidean Distance in Python using distance.euclidean()

# Python code to find Euclidean distance
# using distance.euclidean() method

# Import SciPi Library
from scipy.spatial import distance

# initializing points in
# numpy arrays
point1 = (4, 4, 2)
point2 = (1, 2, 1)
 
# print Euclidean distance 
print(distance.euclidean(point1,point2))
Source by itsmycode.com #
 
PREVIOUS NEXT
Tagged: #Calculate #Euclidean #Distance #Python
ADD COMMENT
Topic
Name
1+2 =