1
0
mirror of https://github.com/microsoft/qlib.git synced 2026-07-10 22:36:55 +08:00

Fix deprecated syntax in numpy (#1507)

* Fix deprecated syntax in numpy

* Replace np.bool with bool
This commit is contained in:
Chaoying
2023-05-08 16:17:02 +08:00
committed by GitHub
parent b084c352f5
commit 37a59f28d3
3 changed files with 3 additions and 3 deletions

View File

@@ -417,7 +417,7 @@ class TSDataSampler:
# NOTE: bool(np.nan) is True !!!!!!!!
# make sure reindex comes first. Otherwise extra NaN may appear.
flt_data = flt_data.swaplevel()
flt_data = flt_data.reindex(self.data_index).fillna(False).astype(np.bool)
flt_data = flt_data.reindex(self.data_index).fillna(False).astype(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)[0]]