I have a set of 3D points, where I need to find the distances of every point with all other points. So far I came up with the code as below to calculate the distances between tw
How about two loops instead of one?
distances = [] for i in xrange(npoints-1): for j in range(i+1, npoints): distances.append(np.linalg.norm(x[i]-x[j])