mirror of
https://github.com/webclinic017/drift.git
synced 2026-08-22 15:28:12 +00:00
fix(DataLoader): sort the dataframe when fetching data (#239)
This commit is contained in:
+1
-1
@@ -95,7 +95,7 @@ def __load_data(
|
|||||||
]
|
]
|
||||||
|
|
||||||
X = target_asset_df + asset_dfs + exogenous_dfs
|
X = target_asset_df + asset_dfs + exogenous_dfs
|
||||||
X = pd.concat([df.sort_index().reindex(X[0].index) for df in X], axis=1).fillna(0.0)
|
X = pd.concat([df.reindex(X[0].index) for df in X], axis=1).fillna(0.0)
|
||||||
|
|
||||||
X.index = pd.DatetimeIndex(X.index)
|
X.index = pd.DatetimeIndex(X.index)
|
||||||
|
|
||||||
|
|||||||
@@ -60,4 +60,5 @@ for asset in tqdm(assets):
|
|||||||
return df
|
return df
|
||||||
|
|
||||||
dfs = pd.concat([load_df(path + file) for file in files], axis=0)
|
dfs = pd.concat([load_df(path + file) for file in files], axis=0)
|
||||||
|
dfs.sort_index(inplace=True)
|
||||||
dfs.to_parquet(f"./data/5min_crypto/{asset}.parquet")
|
dfs.to_parquet(f"./data/5min_crypto/{asset}.parquet")
|
||||||
|
|||||||
Reference in New Issue
Block a user