Open hmacdope opened 1 month ago
Shouldn't we also add the transpose right away
dist[i, j] = dist[j, i] = d[k]
if we want the full NxN matrix?
Yea that as well
Any reason not to suggest using squareform
for this?
No good reason — I didn't know about squareform
.
There's the pedagogical advantage of showing exactly what the relationship between input and output is but the scipy docs also contain it.
One would just need to check that our output of self_distance_array
is actually compatible with the scipy convention.
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.