Nov-12-2020, 11:26 AM
i have this code, i tried to calculate euclidean distance on each element on list1
it throws an error if list1 has 2 elements, any idea on this?
prints :
it throws an error if list1 has 2 elements, any idea on this?
1 2 3 4 5 6 7 |
import numpy as np from scipy.spatial import distance list1 = [( 10.2 , 20.2 ),( 5.3 , 9.2 )] list2 = [( 2.2 , 3.3 )] list1 = np.array(list1) dist1 = distance.euclidean(list1,list2) print ( "distance" ,dist1) |
1 |
ValueError: Input vector should be 1 - D. |