When using seaborn
clustermap
method, the resulting plot has less columns that the input dataframe. Does anyone know when this can happen?
The input data is a 70x64 dataframe ofcounts, filled mostly with 0s. No row or column is ever all 0s As can be seen here: https://pastebin.com/v5D8MRTP
import seaborn as sns
import pandas as pd
import scipy
cluster_df = pd.read_csv("some/path/to.csv)")
# Generate clustering on binary data
row_clus = scipy.cluster.hierarchy.linkage(np.where(cluster_df > 0, 1, 0), method = "ward")
col_clus = scipy.cluster.hierarchy.linkage(np.where(cluster_df.transpose() > 0, 1, 0), method = "ward")
# Clustering heatmap
plot_clus = sns.clustermap(cluster_df, standard_scale = None,
row_linkage = row_clus,
col_linkage = col_clus)
This results in the following, which I get even if just calling sns.clustermap(cluster_df)
: