From eac7a8326536a39aa8febe161462712c8e309664 Mon Sep 17 00:00:00 2001 From: sam Date: Wed, 14 Aug 2024 11:57:24 +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 ec3a156..4942c8a 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 = sample.append(new_data_point, ignore_index=True) + sample = pd.concat([sample, 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 = ret.append(tmp, ignore_index=True) + ret = pd.concat([ret, tmp], ignore_index=True) return ret diff --git a/pyFTS/models/multivariate/mvfts.py b/pyFTS/models/multivariate/mvfts.py index aba3afb..e1af21c 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 = ndata.append(new_data_point, ignore_index=True) + ndata = pd.concat([ndata, 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 = lo.append(new_data_point_lo, ignore_index=True) - up = up.append(new_data_point_up, ignore_index=True) + lo = pd.concat([lo, new_data_point_lo], ignore_index=True) + up = pd.concat([up, new_data_point_up], ignore_index=True) return ret[-steps:]