From fc771ba0171cb2b447e0ae92fcdc7769373313ea Mon Sep 17 00:00:00 2001 From: skhan59bbk Date: Sat, 9 Nov 2024 16:48:44 +0000 Subject: [PATCH] catering for FutureWarning DataFrame.fillna with method is deprecated, Use obj.ffill() or obj.bfill() instead. --- finmarketpy/economics/techindicator.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/finmarketpy/economics/techindicator.py b/finmarketpy/economics/techindicator.py index 077df48..6b99bd4 100644 --- a/finmarketpy/economics/techindicator.py +++ b/finmarketpy/economics/techindicator.py @@ -58,12 +58,12 @@ def create_tech_ind( self._techind = None if tech_params.fillna: - data_frame = data_frame_non_nan.fillna(method="ffill") + data_frame = data_frame_non_nan.ffill() else: data_frame = data_frame_non_nan if data_frame_non_nan_early is not None: - data_frame_early = data_frame_non_nan_early.fillna(method="ffill") + data_frame_early = data_frame_non_nan_early.ffill() if name == "SMA": @@ -236,7 +236,7 @@ def create_tech_ind( signal[buys] = 1 signal[sells] = -1 signal[~(buys | sells)] = np.nan - signal = signal.fillna(method='ffill') + signal = signal.ffill() self._signal = signal @@ -272,7 +272,7 @@ def create_tech_ind( signal[buys] = 1 signal[sells] = -1 signal[~(buys | sells)] = np.nan - signal = signal.fillna(method='ffill') + signal = signal.ffill() self._signal = signal self._signal.iloc[0:tech_params.bb_period] = np.nan