This is a test version of Biostars. For the public version, visit https://www.biostars.org.
How does this array become this matrix?

Greetings.

While studying clustering analysis, I got a question which about Distance matrix.

In Biopython example code,

import numpy as np
import pandas as pd
from Bio.Cluster import distancematrix
data=np.array([[0, 1,  2,  3],[4, 5,  6,  7],[8, 9, 10, 11],[1, 2,  3,  4]])
matrix = distancematrix(data)
distances = distancematrix(data, dist='e')
print(distances)

This code's result is this:

[array([], dtype=float64), array([16.]), array([64., 16.]), array([ 1.,  9., 49.])]

but how can I convert this array for

enter image description here

this matrix?

biopython

0 answers

No answers yet.

Log in to answer this question.