From e1a2b9c2977a0817eb245c704d2e478211585886 Mon Sep 17 00:00:00 2001 From: Florian Roessler Date: Thu, 29 Aug 2019 15:05:43 +0200 Subject: [PATCH] updated the change a bit to prevent unnessary copy operations --- python/fbprophet/forecaster.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/python/fbprophet/forecaster.py b/python/fbprophet/forecaster.py index 7ea887e..c3f8a79 100644 --- a/python/fbprophet/forecaster.py +++ b/python/fbprophet/forecaster.py @@ -262,8 +262,10 @@ class Prophet(object): raise ValueError('Found non-boolean in column ' + condition_name) df[condition_name] = df[condition_name].astype('bool') - df = df.reset_index(drop=True) + if df.index.name == 'ds': + df.index.name = None df = df.sort_values('ds') + df = df.reset_index(drop=True) self.initialize_scales(initialize_scales, df)