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

Add catboost config and notebook

This commit is contained in:
Jactus
2020-11-19 17:18:18 +08:00
parent df406d58a5
commit c91698287a
9 changed files with 415 additions and 87 deletions

View File

@@ -32,7 +32,10 @@ def get_level_index(df: pd.DataFrame, level=Union[str, int]) -> int:
def fetch_df_by_index(
df: pd.DataFrame, selector: Union[pd.Timestamp, slice, str, list], level: Union[str, int], fetch_orig=True,
df: pd.DataFrame,
selector: Union[pd.Timestamp, slice, str, list],
level: Union[str, int],
fetch_orig=True,
) -> pd.DataFrame:
"""
fetch data from `data` with `selector` and `level`
@@ -55,8 +58,12 @@ def fetch_df_by_index(
if fetch_orig:
for slc in idx_slc:
if slc != slice(None, None):
return df.loc[pd.IndexSlice[idx_slc],]
return df.loc[
pd.IndexSlice[idx_slc],
]
else:
return df
else:
return df.loc[pd.IndexSlice[idx_slc],]
return df.loc[
pd.IndexSlice[idx_slc],
]