From 74defe624681d4899ce0fcc1af8bdaab96055484 Mon Sep 17 00:00:00 2001 From: Arnaud TOURNIER Date: Thu, 17 Mar 2022 13:05:09 +0100 Subject: [PATCH] use pd.concat instead of append (perf and warning) --- src/pytti/ImageGuide.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/pytti/ImageGuide.py b/src/pytti/ImageGuide.py index 804a9d7..638c729 100644 --- a/src/pytti/ImageGuide.py +++ b/src/pytti/ImageGuide.py @@ -329,12 +329,10 @@ def train( df.index.name = "Step" else: for j, (df, loss) in enumerate(zip(self.dataframe, losses_raw)): - self.dataframe[j] = df.append( - pd.DataFrame( - {str(k): float(v) for k, v in loss.items()}, index=[i] - ), - ignore_index=False, - ) + frames = [df] + [pd.DataFrame( + {str(k): float(v) for k, v in loss.items()}, index=[i] + )] + self.dataframe[j] = pd.concat(frames, ignore_index=False) self.dataframe[j].name = "Step" return {"TOTAL": float(total_loss)}