When trying to access the reordered indices from a clustermap object via clustergrid.dendrogram_row.reordered_ind or lustergrid.dendrogram_col.reordered_ind, I get back lists of integers corresponding to the positions of the rows/columns in the input dataframe. To me, it would make much more sense to return the list of reordered index names or columns names corresponding to the dataframe. Pandas dataframe column names and indices are nicely handled by clustermap when plotting and it would be more self-consistent if we could access those, rather than positions in the dataframe. What do you think?
df.index[reordered_ind]. Don't think the change is worth breaking code that assumes the current representation.
Right, I should have thought about that. Thanks for the quick reply!
I'm currently having issues with reordered_ind not showing indices corresponding to the displayed clustering. I seem to have found a workaround in the form of the following DataFrame <ClusterGrid>.data2d which appears to be ordered as the ClusterMap is displayed, which has corresponding
<ClusterGrid>.data2d.index and <ClusterGrid>.data2d.columns items – perhaps what you (or at least many of those landing on this issue) were after.
Most helpful comment
I'm currently having issues with
reordered_indnot showing indices corresponding to the displayed clustering. I seem to have found a workaround in the form of the following DataFrame<ClusterGrid>.data2dwhich appears to be ordered as the ClusterMap is displayed, which has corresponding<ClusterGrid>.data2d.indexand<ClusterGrid>.data2d.columnsitems – perhaps what you (or at least many of those landing on this issue) were after.