From 4b348ad818fa0cdc59c1b089454ff5d82158713c Mon Sep 17 00:00:00 2001 From: sam Date: Wed, 14 Aug 2024 12:08:26 +0400 Subject: [PATCH] replacing the deprecated append method with the concat method in pandas --- pyFTS/models/multivariate/cmvfts.py | 4 ++-- pyFTS/models/multivariate/mvfts.py | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pyFTS/models/multivariate/cmvfts.py b/pyFTS/models/multivariate/cmvfts.py index 4942c8a..d9c245d 100644 --- a/pyFTS/models/multivariate/cmvfts.py +++ b/pyFTS/models/multivariate/cmvfts.py @@ -146,7 +146,7 @@ class ClusteredMVFTS(mvfts.MVFTS): new_data_point[self.target_variable.data_label] = tmp.expected_value() - sample = pd.concat([sample, new_data_point], ignore_index=True) + sample = pd.concat([sample, pd.DataFrame([new_data_point])], ignore_index=True) return ret[-steps:] @@ -199,7 +199,7 @@ class ClusteredMVFTS(mvfts.MVFTS): for k in np.arange(0, steps): sample = ret.iloc[k:self.order+k] tmp = self.forecast_multivariate(sample, **kwargs) - ret = pd.concat([ret, tmp], ignore_index=True) + ret = pd.concat([ret, pd.DataFrame([tmp])], ignore_index=True) return ret diff --git a/pyFTS/models/multivariate/mvfts.py b/pyFTS/models/multivariate/mvfts.py index e1af21c..fdaf40d 100644 --- a/pyFTS/models/multivariate/mvfts.py +++ b/pyFTS/models/multivariate/mvfts.py @@ -211,7 +211,7 @@ class MVFTS(fts.FTS): new_data_point[self.target_variable.data_label] = tmp - ndata = pd.concat([ndata, new_data_point], ignore_index=True) + ndata = pd.concat([ndata, pd.DataFrame([new_data_point])], ignore_index=True) return ret[-steps:] @@ -307,8 +307,8 @@ class MVFTS(fts.FTS): new_data_point_lo[self.target_variable.data_label] = min(tmp_lo) new_data_point_up[self.target_variable.data_label] = max(tmp_up) - lo = pd.concat([lo, new_data_point_lo], ignore_index=True) - up = pd.concat([up, new_data_point_up], ignore_index=True) + lo = pd.concat([lo, pd.DataFrame([new_data_point_lo])], ignore_index=True) + up = pd.concat([up, pd.DataFrame([new_data_point_up])], ignore_index=True) return ret[-steps:]