diff --git a/freqtrade/freqai/data_drawer.py b/freqtrade/freqai/data_drawer.py index 6316c0a86..4d41faa83 100644 --- a/freqtrade/freqai/data_drawer.py +++ b/freqtrade/freqai/data_drawer.py @@ -280,7 +280,7 @@ class FreqaiDataDrawer: # set new_pred values to nans (we want to signal to user that there was nothing # historically made during downtime. The newest pred will get appeneded later in # append_model_predictions) - new_pred.iloc[:, :] = np.nan + new_pred.iloc[:, :] = np.nan.astype(new_pred.dtypes) new_pred["date_pred"] = dataframe["date"] hist_preds = self.historic_predictions[pair].copy() diff --git a/freqtrade/freqai/data_kitchen.py b/freqtrade/freqai/data_kitchen.py index 4c30ce690..3b4c5d817 100644 --- a/freqtrade/freqai/data_kitchen.py +++ b/freqtrade/freqai/data_kitchen.py @@ -24,6 +24,8 @@ from freqtrade.strategy import merge_informative_pair from freqtrade.strategy.interface import IStrategy +pd.set_option('future.no_silent_downcasting', True) + SECONDS_IN_DAY = 86400 SECONDS_IN_HOUR = 3600 @@ -221,7 +223,7 @@ class FreqaiDataKitchen: filtered_df = filtered_df.replace([np.inf, -np.inf], np.nan) drop_index = pd.isnull(filtered_df).any(axis=1) # get the rows that have NaNs, - drop_index = drop_index.replace(True, 1).replace(False, 0) # pep8 requirement. + drop_index = drop_index.replace(True, 1).replace(False, 0).infer_objects(copy=False) if (training_filter): # we don't care about total row number (total no. datapoints) in training, we only care @@ -229,7 +231,9 @@ class FreqaiDataKitchen: # if labels has multiple columns (user wants to train multiple modelEs), we detect here labels = unfiltered_df.filter(label_list, axis=1) drop_index_labels = pd.isnull(labels).any(axis=1) - drop_index_labels = drop_index_labels.replace(True, 1).replace(False, 0) + drop_index_labels = drop_index_labels.replace( + True, 1 + ).replace(False, 0).infer_objects(copy=False) dates = unfiltered_df['date'] filtered_df = filtered_df[ (drop_index == 0) & (drop_index_labels == 0)