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?
it throws an error if list1 has 2 elements, any idea on this?
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)prints :
ValueError: Input vector should be 1-D.