From c04a05578d06b1497eb903c92448922d790ed505 Mon Sep 17 00:00:00 2001 From: Thomas Dekelver <50994394+tdekelver-bd@users.noreply.github.com> Date: Mon, 5 Feb 2024 15:23:47 +0100 Subject: [PATCH] Bugfix ValueError: truncate requires a sorted index https://github.com/EnergieID/entsoe-py/issues/299#issue-2118677900 --- entsoe/entsoe.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entsoe/entsoe.py b/entsoe/entsoe.py index 457be06..9c52aa2 100644 --- a/entsoe/entsoe.py +++ b/entsoe/entsoe.py @@ -2132,7 +2132,7 @@ def query_physical_crossborder_allborders(self, country_code: Union[Area, str], continue im.name = neighbour imports.append(im) - df = pd.concat(imports, axis=1) + df = pd.concat(imports, axis=1, sort=True) # drop columns that contain only zero's df = df.loc[:, (df != 0).any(axis=0)] df = df.tz_convert(area.tz)