Skip to content

Commit 026de52

Browse files
committed
resolve hard code
1 parent 8b4215a commit 026de52

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ dependencies = [
4444
"matplotlib",
4545
"jupyter",
4646
"nbconvert",
47+
"pyarrow",
4748
]
4849

4950
[project.optional-dependencies]

qlib/data/dataset/loader.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -280,10 +280,7 @@ def _maybe_load_raw_data(self):
280280
self._data.sort_index(inplace=True)
281281
elif isinstance(self._config, (str, Path)):
282282
if str(self._config).strip().endswith(".h5"):
283-
df = pd.read_hdf(Path(self._config), key="data")
284-
df = df.set_index(["datetime", "instrument"])
285-
df.index = df.index.set_levels([pd.to_datetime(df.index.levels[0]), df.index.levels[1]])
286-
self._data = df
283+
self._data = pd.read_parquet(self._config, engine="parquet")
287284
else:
288285
with Path(self._config).open("rb") as f:
289286
self._data = pickle.load(f)

0 commit comments

Comments
 (0)