Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

Calculate Euclidean Distance in Python using norm()

# Python code to find Euclidean distance
# using linalg.norm()

# Import NumPy Library
import numpy as np

# initializing points in
# numpy arrays
point1 = np.array((4, 4, 2))
point2 = np.array((1, 2, 1))

# calculate Euclidean distance
# using linalg.norm() method
dist = np.linalg.norm(point1 - point2)

# printing Euclidean distance
print(dist)
Comment

PREVIOUS NEXT
Code Example
Python :: python align label left 
Python :: django query multiple conditions 
Python :: jupyter tabnine for jupyter notebook 
Python :: python print string name in pattern 
Python :: matplotlib subplots 
Python :: entered_text_1 = textbox_1.get(1.0, tk.END+"-1c") 
Python :: how to loop through string in python 
Python :: xlabel and ylabel in python 
Python :: python not equal 
Python :: count_values in python 
Python :: handle 404 in requests python 
Python :: turn python script into exe 
Python :: mediana python 
Python :: tensorflow matrix multiplication 
Python :: How to append train and Test dataset in python 
Python :: how to unlist a list in python 
Python :: dir() in python 
Python :: make button bigger tkinter with grid 
Python :: python get the app path 
Python :: python last item in list 
Python :: how to get the type of numpy array 
Python :: create new column pandas lambda function assign apply 
Python :: python detect warning 
Python :: iterate over dataframe 
Python :: pandas rename column by dictionary 
Python :: python thread with return values? 
Python :: numpy array unique value counts 
Python :: python array slice 
Python :: how to make a function in python 
Python :: python list pop vs remove 
ADD CONTENT
Topic
Content
Source link
Name
6+6 =