1 year ago

#349970

test-img

Roosha

How to keep track of rows and columns of a matrix when turning it into a block diagonal one?

I am using scipy.linalg.block_diag function to create a block diagonal matrix from a given dataframe which has same number and label for its rows and columns. While the said function can create a block diagonal matrix from the given input, it is not keeping track of the name of the rows and columns of the matrix. Is there anyway to print the ordered list of rows/columns so that once can make a heatmap seaborn plot with given x and y labels?

Thanks,

python-3.x

pandas

scipy

linear-algebra

adjacency-matrix

0 Answers

Your Answer

Accepted video resources