From d631b4450b2864a224da8a0420dcb5031508943f Mon Sep 17 00:00:00 2001 From: Linlang <30293408+SunsetWolf@users.noreply.github.com> Date: Tue, 18 Nov 2025 11:36:56 +0800 Subject: [PATCH] fix(filter): replace invalid with in SeriesDFilter (#2051) --- qlib/data/filter.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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