1
0
mirror of https://github.com/microsoft/qlib.git synced 2026-07-16 17:12:20 +08:00

fix col name error when fetch data (#1904)

* fix col name error when fetch data

* fix col name error when fetch data

* fix install qlib error

* optimize code

* optimize code

* optimize code
This commit is contained in:
Linlang
2025-04-02 18:50:52 +08:00
committed by GitHub
parent 67feeaeb00
commit e7a1b5ea1f
2 changed files with 8 additions and 0 deletions

View File

@@ -23,6 +23,9 @@ description = "A Quantitative-research Platform"
requires-python = ">=3.8.0" requires-python = ">=3.8.0"
readme = {file = "README.md", content-type = "text/markdown"} readme = {file = "README.md", content-type = "text/markdown"}
# On 2025-04-02 osqp released version 1.0.2, osqp is used as a dependency for cvxpy.
# It would lead to errors installing qlib, so we limited the version of osqp.
# refs: https://github.com/osqp/osqp/issues/728
dependencies = [ dependencies = [
"pyyaml", "pyyaml",
"numpy", "numpy",
@@ -39,6 +42,7 @@ dependencies = [
"loguru", "loguru",
"lightgbm", "lightgbm",
"gym", "gym",
"osqp<1.0.2",
"cvxpy", "cvxpy",
"joblib", "joblib",
"matplotlib", "matplotlib",

View File

@@ -339,6 +339,10 @@ class NestedDataLoader(DataLoader):
if df_full is None: if df_full is None:
df_full = df_current df_full = df_current
else: else:
current_columns = df_current.columns.tolist()
full_columns = df_full.columns.tolist()
columns_to_drop = [col for col in current_columns if col in full_columns]
df_full.drop(columns=columns_to_drop, inplace=True)
df_full = pd.merge(df_full, df_current, left_index=True, right_index=True, how=self.join) df_full = pd.merge(df_full, df_current, left_index=True, right_index=True, how=self.join)
return df_full.sort_index(axis=1) return df_full.sort_index(axis=1)