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

type error bug

This commit is contained in:
Young
2021-08-20 09:50:47 +00:00
committed by you-n-g
parent 9c326fd398
commit 13a9b7cea0

View File

@@ -392,8 +392,10 @@ class Indicator:
if isinstance(price_s, pd.Series):
price_s = IndexData(price_s.values, list(price_s.index))
if isinstance(price_s, (int, float)):
elif isinstance(price_s, (int, float, np.floating)):
price_s = IndexData([price_s], [trade_start_time])
else:
raise NotImplementedError(f"This type of input is not supported")
# NOTE: there are some zeros in the trading price. These cases are known meaningless
# for aligning the previous logic, remove it.