From 4674e49e90fd76f9fbd9b2d917ab4382baf831fa Mon Sep 17 00:00:00 2001 From: Ian Lumsden Date: Sun, 14 Jul 2024 14:13:49 -0700 Subject: [PATCH] Improves performance of QL by changing how the QL extracts node data when using MultiIndex --- hatchet/query/engine.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hatchet/query/engine.py b/hatchet/query/engine.py index 1f0bc7b5..9717e240 100644 --- a/hatchet/query/engine.py +++ b/hatchet/query/engine.py @@ -75,7 +75,7 @@ def _cache_node(self, node, query, dframe): _, filter_func = node_query row = None if isinstance(dframe.index, pd.MultiIndex): - row = pd.concat([dframe.loc[node]], keys=[node], names=["node"]) + row = dframe.xs(node, level="node", drop_level=False) else: row = dframe.loc[node] if filter_func(row):