Consider that I have n x 64 array and m x 64 array. I want to find the best n pairs that is a result of following :
list_best=[]
for nn in range(n):
ele_n = nx64_array[nn,:]
ele_best = np.ones_like(ele_n)
for mm in range(m):
ele_m = mx64_array[mm,:]
diff = np.sum(np.abs(ele_n - ele_m))
if diff<ele_best : ele_best = ele_m
list_best.append(ele_best)
But what I want to know is there is any numpy-like way to accomplish this, since for-loop is quite slow.
Is there any way to do this faster? thank you so much.