1
0
mirror of https://github.com/microsoft/qlib.git synced 2026-07-09 22:10:56 +08:00
This commit is contained in:
Jactus
2020-11-24 16:42:32 +08:00
parent acae9087e9
commit 93ce9a4cb2
4 changed files with 30 additions and 35 deletions

View File

@@ -702,10 +702,10 @@ def load_dataset(path_or_obj):
if isinstance(path_or_obj, pd.DataFrame):
return path_or_obj
_, extension = os.path.splitext(path_or_obj)
if extension == '.h5':
if extension == ".h5":
return pd.read_hdf(path_or_obj)
elif extension == '.pkl':
elif extension == ".pkl":
return pd.read_pickle(path_or_obj)
elif extension == '.csv':
elif extension == ".csv":
return pd.read_csv(path_or_obj, parse_dates=True, index_col=[0, 1])
raise ValueError(f'unsupported file type `{extension}`')
raise ValueError(f"unsupported file type `{extension}`")