From b767a96a4baf90e395c6794d071dc68e3ca160ea Mon Sep 17 00:00:00 2001 From: Feda Curic Date: Mon, 10 Oct 2022 14:33:14 +0200 Subject: [PATCH] Add empty col to data frame (#225) Needed to use pandas 1.5.0 --- setup.py | 2 +- src/fmu/ensemble/realization.py | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index d5e2ebe5..7a379f6e 100644 --- a/setup.py +++ b/setup.py @@ -22,7 +22,7 @@ REQUIREMENTS = [ "ecl>=2.9", "numpy", - "pandas<1.5.0", + "pandas", "pyyaml>=5.1", ] diff --git a/src/fmu/ensemble/realization.py b/src/fmu/ensemble/realization.py index 750bc133..9b31d35a 100644 --- a/src/fmu/ensemble/realization.py +++ b/src/fmu/ensemble/realization.py @@ -525,12 +525,14 @@ def load_status(self): errorjobs = status[errorcolumns[0]] != "" # Merge any error strings: - status.loc[errorjobs, "errorstring"] = ( + error_string = ( status.loc[errorjobs, errorcolumns] .astype(str) .apply(" ".join, axis=1) .apply(str.strip) ) + status["errorstring"] = np.nan + status.loc[errorjobs, "errorstring"] = error_string status.drop(errorcolumns, axis=1, inplace=True) # Delete potential unwanted row