1
0
mirror of https://github.com/microsoft/qlib.git synced 2026-07-04 11:30:57 +08:00

Update ops.py

Fix the bug when Sign followed by True/False
This commit is contained in:
Yifan Deng
2020-12-14 01:35:03 +08:00
committed by you-n-g
parent ea4fe1577b
commit c217e7c479

View File

@@ -143,6 +143,11 @@ class Sign(ElemOperator):
def __init__(self, feature):
super(Sign, self).__init__(feature, "sign")
def _load_internal(self, instrument, start_index, end_index, freq):
series = self.feature.load(instrument, start_index, end_index, freq)
series = series.astype(np.float32)
return getattr(np, self.func)(series)
class Log(ElemOperator):
"""Feature Log