Last active
April 28, 2020 19:10
-
-
Save aravindpai/9b21a294d99688f4e6aa0f6d471dd635 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%%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