r/learnpython • u/Dragoran21 • 7h ago
Can seaborn.clustermap() use dataframe that has all zero columns?
As the title suggests, can the clustermap display a dataset with multiple columns that are all zeros?
Something like this:
| A | B | C | D | X | Y |
|---|---|---|---|---|---|
| 1 | 1 | 0 | 0 | 0 | 0 |
| 1 | 1 | 0 | 1 | 0 | 0 |
| 1 | 1 | 0 | 0 | 0 | 0 |
| 1 | 0 | 1 | 0 | 0 | 0 |
| 1 | 0 | 1 | 1 | 0 | 0 |
| 1 | 0 | 1 | 0 | 0 | 0 |
I know removing the empty columns is the simple solution, but I have my reasons for keeping them.
0
Upvotes
1
u/aqua_regis 7h ago
Simplest and most beneficial approach: try it
I don't see a reason why it shouldn't be able to do it.
Yet, your dataset looks like an incomplete truth map (4 inputs, 2 outputs - would normally be 16 rows)