I have a table something like this:
A | B | C | |
---|---|---|---|
1 | 1 | 1 | 1 |
2 | 0 | 1 | 1 |
3 | 0 | 0 | 1 |
Where each cell is containing whether the row is connected to the specified column.
I want to transform this into a table like this:
A | B | C | |
---|---|---|---|
A | 1 | 1 | 1 |
B | 1 | 2 | 2 |
C | 1 | 2 | 3 |
Where each cell contains the number of rows (from the original table) that has both connected to the specific column and row name in the second table.
For example, the 3 in the second table means that there are 3 rows in the original table that is connected to the B and C columns.
The goal is to plot a heatmap from the second table using plotly.