diff --git a/qlib/data/filter.py b/qlib/data/filter.py index 5057e20a4..246d6baf7 100644 --- a/qlib/data/filter.py +++ b/qlib/data/filter.py @@ -168,7 +168,7 @@ class SeriesDFilter(BaseDFilter): for _ts, _bool in timestamp_series.items(): # there is likely to be NAN when the filter series don't have the # bool value, so we just change the NAN into False - if _bool == np.nan: + if np.isnan(_bool): _bool = False if _lbool is None: _cur_start = _ts