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

static data loader supports fields_group

This commit is contained in:
Dong Zhou
2020-11-24 22:43:34 +08:00
parent dfa8bc10a5
commit db9758575b
2 changed files with 13 additions and 29 deletions

View File

@@ -701,6 +701,8 @@ def load_dataset(path_or_obj):
"""load dataset from multiple file formats"""
if isinstance(path_or_obj, pd.DataFrame):
return path_or_obj
if not os.path.exists(path_or_obj):
raise ValueError(f'file {path_or_obj} doesn\'t exist')
_, extension = os.path.splitext(path_or_obj)
if extension == ".h5":
return pd.read_hdf(path_or_obj)