You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The documentation for self_distance_array has the following as the suggested way to reconstruct a full NxN distance matrix from the flattened upper triangular (-diagonal) N*(N-2) // 2 result.
for i in range(n):
for j in range(i + 1, n):
k += 1
dist[i, j] = d[k]
This is incorrect as the increment must come after the assignment, otherwise you attempt to access N+1 the element of the array on final iteration.
The below is correct.
for i in range(n):
for j in range(i + 1, n):
dist[i, j] = d[k]
k += 1
The text was updated successfully, but these errors were encountered:
The documentation for
self_distance_array
has the following as the suggested way to reconstruct a full NxN distance matrix from the flattened upper triangular (-diagonal) N*(N-2) // 2 result.This is incorrect as the increment must come after the assignment, otherwise you attempt to access N+1 the element of the array on final iteration.
The below is correct.
The text was updated successfully, but these errors were encountered: