From 68f21d534ce3f24857e1324d613e240c4a9eab96 Mon Sep 17 00:00:00 2001 From: lukas leufen <l.leufen@fz-juelich.de> Date: Fri, 28 Jan 2022 15:49:21 +0100 Subject: [PATCH] applied bug fix, /close #358 --- mlair/run_modules/post_processing.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mlair/run_modules/post_processing.py b/mlair/run_modules/post_processing.py index 9cd9fce9..add42587 100644 --- a/mlair/run_modules/post_processing.py +++ b/mlair/run_modules/post_processing.py @@ -1014,6 +1014,7 @@ class PostProcessing(RunEnvironment): report_path = os.path.join(self.data_store.get("experiment_path"), "latex_report") path_config.check_path_and_create(report_path) res = [] + max_cols = 0 for boot_type, d0 in results.items(): for boot_method, d1 in d0.items(): for station_name, vals in d1.items(): @@ -1022,8 +1023,9 @@ class PostProcessing(RunEnvironment): res.append([boot_type, boot_method, station_name, boot_var, ahead, *vals.sel({self.boot_var_dim: boot_var, self.ahead_dim: ahead}).values.round(5).tolist()]) + max_cols = max(max_cols, len(res[-1])) col_names = [self.model_type_dim, "method", "station", self.boot_var_dim, self.ahead_dim, - *list(range(len(res[0]) - 5))] + *list(range(max_cols - 5))] df = pd.DataFrame(res, columns=col_names) file_name = "feature_importance_skill_score_report_raw.csv" df.to_csv(os.path.join(report_path, file_name), sep=";") -- GitLab