From ee828a51d36cf0bed3bde8128babdc4c0548b0b4 Mon Sep 17 00:00:00 2001 From: Michael Richard Mckinsey Date: Tue, 26 Mar 2024 15:19:07 -0700 Subject: [PATCH] Fix printout for MultiIndex columns --- hatchet/external/console.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/hatchet/external/console.py b/hatchet/external/console.py index 613b523a..82ea5ba0 100644 --- a/hatchet/external/console.py +++ b/hatchet/external/console.py @@ -327,7 +327,10 @@ def render_frame(self, node, dataframe, indent="", child_indent=""): else: metric_str += " [{}]".format(annotation_content) - node_name = dataframe.loc[df_index, self.name] + if isinstance(dataframe.columns, pd.MultiIndex): + node_name = dataframe.loc[df_index, (self.name, "")] + else: + node_name = dataframe.loc[df_index, self.name] if self.expand is False: if len(node_name) > 39: node_name = (