Skip to content

Commit 9e3d024

Browse files
authored
fix bug (#950)
fix bug in elif isinstance(self.N, float) and 0 < self.N < 1:
1 parent 2ac964c commit 9e3d024

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

qlib/data/ops.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -726,7 +726,7 @@ def _load_internal(self, instrument, start_index, end_index, freq):
726726
# isnull = series.isnull() # NOTE: isnull = NaN, inf is not null
727727
if isinstance(self.N, int) and self.N == 0:
728728
series = getattr(series.expanding(min_periods=1), self.func)()
729-
elif isinstance(self.N, int) and 0 < self.N < 1:
729+
elif isinstance(self.N, float) and 0 < self.N < 1:
730730
series = series.ewm(alpha=self.N, min_periods=1).mean()
731731
else:
732732
series = getattr(series.rolling(self.N, min_periods=1), self.func)()

0 commit comments

Comments
 (0)