I would like to evaluate the euclidian distance from a fixed point to several points, I want to do it through a loop. Why is not working? I also tried without the '-1' for the range but still not working
from scipy.spatial import distance
vettore = np.array(np.mat('1 2; 3 4;6,7;8,9;10,12'))
posizione= np.array(np.mat('2,2'))
codio= []
for i in range(0,len(vettore)-1):
codio[i]=distance.euclidean(vettore[i],posizione)
codio
>>> IndexError: list assignment index out of range