From 445af1da180dd37cb7e5c47ceb96139bbdacf4cf Mon Sep 17 00:00:00 2001 From: Hendrik Huyskens Date: Wed, 5 Jun 2024 10:53:28 +0200 Subject: [PATCH] Fix postprocessing error for oemof entries with more than 2 node items --- CHANGELOG.rst | 2 ++ src/oemof/tabular/postprocessing/core.py | 2 ++ 2 files changed, 4 insertions(+) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index fb6f999c..f2d1819a 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -11,6 +11,8 @@ Features Fixes +* MultiIndexError in postprocessing if more than 2 oemof nodes are given `#174 `_ + 0.0.5 Patch Release - Miraculous Mary (2024-02-23) ----------------------------------------------------- diff --git a/src/oemof/tabular/postprocessing/core.py b/src/oemof/tabular/postprocessing/core.py index 56fd7f4b..b30f817a 100644 --- a/src/oemof/tabular/postprocessing/core.py +++ b/src/oemof/tabular/postprocessing/core.py @@ -106,6 +106,8 @@ def convert_to_pandas(value): for key, series in data.items(): if series.empty: continue + if len(key) != 2: + continue if data_key == "period_scalars": series = series.transpose() mindex = pd.MultiIndex.from_tuples(