Skip to content

Instantly share code, notes, and snippets.

@ctralie
Created August 9, 2025 14:32
Show Gist options
  • Save ctralie/8b1d734d0f792cfafb82f5181eda8b35 to your computer and use it in GitHub Desktop.
Save ctralie/8b1d734d0f792cfafb82f5181eda8b35 to your computer and use it in GitHub Desktop.
N = X.shape[0]
d = X.shape[1]
D = np.zeros((N, N))
for i in range(N):
Xi = X[i, :]
for j in range(N):
Xj = X[j, :]
D[i, j] = np.sqrt(np.sum((Xi - Xj)**2))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment