Skip to content

Commit

Permalink
fix bug (microsoft#950)
Browse files Browse the repository at this point in the history
fix bug in  elif isinstance(self.N, float) and 0 < self.N < 1:
  • Loading branch information
wan9c9 authored Mar 6, 2022
1 parent 2ac964c commit 9e3d024
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion qlib/data/ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)()
Expand Down

0 comments on commit 9e3d024

Please sign in to comment.