Skip to content

Instantly share code, notes, and snippets.

@aravindpai
Last active April 28, 2020 19:10
Show Gist options
  • Save aravindpai/9b21a294d99688f4e6aa0f6d471dd635 to your computer and use it in GitHub Desktop.
Save aravindpai/9b21a294d99688f4e6aa0f6d471dd635 to your computer and use it in GitHub Desktop.
%%time
from scipy.spatial import distance
def compute_distance(midpoints,num):
dist = np.zeros((num,num))
for i in range(num):
for j in range(i+1,num):
if i!=j:
dst = distance.euclidean(midpoints[i], midpoints[j])
dist[i][j]=dst
return dist
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment