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

fast fillna (#1074)

* fast fillna

* fix TSDataSampler bug
This commit is contained in:
you-n-g
2022-04-24 23:24:32 +08:00
committed by GitHub
parent caea495f40
commit cd5e5d5235
2 changed files with 8 additions and 2 deletions

View File

@@ -350,7 +350,7 @@ class TSDataSampler:
flt_data = flt_data.reindex(self.data_index).fillna(False).astype(np.bool)
self.flt_data = flt_data.values
self.idx_map = self.flt_idx_map(self.flt_data, self.idx_map)
self.data_index = self.data_index[np.where(self.flt_data is True)[0]]
self.data_index = self.data_index[np.where(self.flt_data)[0]]
self.idx_map = self.idx_map2arr(self.idx_map)
self.start_idx, self.end_idx = self.data_index.slice_locs(