@@ -676,7 +676,7 @@ def set_initial_historic_predictions(
676676 self .set_start_dry_live_date (strat_df )
677677
678678 for label in hist_preds_df .columns :
679- if hist_preds_df [label ].dtype == object :
679+ if pd . api . types . is_string_dtype ( hist_preds_df [label ].dtype ) :
680680 continue
681681 hist_preds_df [f"{ label } _mean" ] = 0
682682 hist_preds_df [f"{ label } _std" ] = 0
@@ -706,7 +706,7 @@ def fit_live_predictions(self, dk: FreqaiDataKitchen, pair: str) -> None:
706706 num_candles = self .freqai_info .get ("fit_live_predictions_candles" , 100 )
707707 dk .data ["labels_mean" ], dk .data ["labels_std" ] = {}, {}
708708 for label in full_labels :
709- if self .dd .historic_predictions [dk .pair ][label ].dtype == object :
709+ if pd . api . types . is_string_dtype ( self .dd .historic_predictions [dk .pair ][label ].dtype ) :
710710 continue
711711 f = spy .stats .norm .fit (self .dd .historic_predictions [dk .pair ][label ].tail (num_candles ))
712712 dk .data ["labels_mean" ][label ], dk .data ["labels_std" ][label ] = f [0 ], f [1 ]
@@ -896,7 +896,7 @@ def backtesting_fit_live_predictions(self, dk: FreqaiDataKitchen):
896896 ]
897897 self .fit_live_predictions (self .dk , self .dk .pair )
898898 for label in label_columns :
899- if dk .full_df [label ].dtype == object :
899+ if pd . api . types . is_string_dtype ( dk .full_df [label ].dtype ) :
900900 continue
901901 if "labels_mean" in self .dk .data :
902902 dk .full_df .at [index , f"{ label } _mean" ] = self .dk .data ["labels_mean" ][
0 commit comments