From a51ec762446c549234342364eb9d048049865eba Mon Sep 17 00:00:00 2001 From: Chao Wang Date: Fri, 4 Mar 2022 06:21:03 -0500 Subject: [PATCH] fix bug fix bug in elif isinstance(self.N, float) and 0 < self.N < 1: --- qlib/data/ops.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qlib/data/ops.py b/qlib/data/ops.py index 555a29ba436..a0a0668170b 100644 --- a/qlib/data/ops.py +++ b/qlib/data/ops.py @@ -726,7 +726,7 @@ def _load_internal(self, instrument, start_index, end_index, freq): # isnull = series.isnull() # NOTE: isnull = NaN, inf is not null if isinstance(self.N, int) and self.N == 0: series = getattr(series.expanding(min_periods=1), self.func)() - elif isinstance(self.N, int) and 0 < self.N < 1: + elif isinstance(self.N, float) and 0 < self.N < 1: series = series.ewm(alpha=self.N, min_periods=1).mean() else: series = getattr(series.rolling(self.N, min_periods=1), self.func)()