1
0
mirror of https://github.com/microsoft/qlib.git synced 2026-07-19 10:24:35 +08:00

fix nanmean

This commit is contained in:
wangwenxi.handsome
2021-08-17 12:45:37 +00:00
committed by you-n-g
parent 8eb7a1fddc
commit f7d7f1a223
2 changed files with 9 additions and 12 deletions

View File

@@ -330,7 +330,9 @@ class Indicator:
# sum inner order indicators with same metric.
all_metric = ["inner_amount", "deal_amount", "trade_price", "trade_value", "trade_cost", "trade_dir"]
self.order_indicator_cls.sum_all_indicators(self.order_indicator, inner_order_indicators, all_metric, fill_value=0)
self.order_indicator_cls.sum_all_indicators(
self.order_indicator, inner_order_indicators, all_metric, fill_value=0
)
def func(trade_price, deal_amount):
# trade_price is np.NaN instead of inf when deal_amount is zero.