1
0
mirror of https://github.com/microsoft/qlib.git synced 2026-07-06 20:41:09 +08:00
This commit is contained in:
Young
2021-08-31 09:52:32 +00:00
committed by you-n-g
parent 9a74471ab6
commit 5f0ee6ce68
3 changed files with 35 additions and 13 deletions

View File

@@ -167,11 +167,14 @@ class CN1minNumpyQuote(BaseQuote):
def _agg_data(self, data: IndexData, method):
"""Agg data by specific method."""
# FIXME: why not call the method of data directly?
if method == "sum":
return np.nansum(data)
elif method == "mean":
return np.nanmean(data)
elif method == "last":
# FIXME: I've never seen that this method was called.
# Please merge it with "ts_data_last"
return data[-1]
elif method == "all":
return data.all()