From 15a971346d63deeb6af706f9f42ee23a327d9ae8 Mon Sep 17 00:00:00 2001 From: robcaulk Date: Thu, 2 Jun 2022 17:12:12 +0200 Subject: [PATCH] catch infinity values when filtering --- freqtrade/freqai/data_kitchen.py | 1 + 1 file changed, 1 insertion(+) diff --git a/freqtrade/freqai/data_kitchen.py b/freqtrade/freqai/data_kitchen.py index dceb721c5..7e7cedc8d 100644 --- a/freqtrade/freqai/data_kitchen.py +++ b/freqtrade/freqai/data_kitchen.py @@ -272,6 +272,7 @@ class FreqaiDataKitchen: :labels: labels cleaned of NaNs. """ filtered_dataframe = unfiltered_dataframe.filter(training_feature_list, axis=1) + filtered_dataframe = filtered_dataframe.replace([np.inf, -np.inf], np.nan) drop_index = pd.isnull(filtered_dataframe).any(1) # get the rows that have NaNs, drop_index = drop_index.replace(True, 1).replace(False, 0) # pep8 requirement. if (