TypeError: mean() got an unexpected keyword argument 'level'
🐛 Bug Description
To Reproduce
Steps to reproduce the behavior:
(qlib_test) roger@beijing:~/anaconda3/envs/rdagent_test/lib/python3.10/site-packages/rdagent/qlib_repo/qlib/examples/highfreq$ qrun workflow_config_High_Freq_Tree_Alpha158.yaml [290722:MainThread](2025-05-06 19:00:03,943) INFO - qlib.qrun - [cli.py:78] - Render the template with the context: {} [290722:MainThread](2025-05-06 19:00:03,950) INFO - qlib.Initialization - [config.py:420] - default_conf: client. [290722:MainThread](2025-05-06 19:00:03,952) INFO - qlib.Initialization - [init.py:74] - qlib successfully initialized based on client settings. [290722:MainThread](2025-05-06 19:00:03,952) INFO - qlib.Initialization - [init.py:76] - data_path={'__DEFAULT_FREQ': PosixPath('/home/roger/.qlib/qlib_data/cn_data_1min')} [290722:MainThread](2025-05-06 19:00:03,956) WARNING - qlib.workflow - [expm.py:231] - No valid experiment found. Create a new experiment with name workflow. [290722:MainThread](2025-05-06 19:00:03,958) INFO - qlib.workflow - [exp.py:258] - Experiment 349096071971132076 starts running ... [290722:MainThread](2025-05-06 19:00:04,220) INFO - qlib.workflow - [recorder.py:345] - Recorder 89be48867a894dc8bc562697f6e09db3 starts running under Experiment 349096071971132076 ... ModuleNotFoundError. CatBoostModel are skipped. (optional: maybe installing CatBoostModel can fix it.) ModuleNotFoundError. XGBModel is skipped(optional: maybe installing xgboost can fix it). ModuleNotFoundError. PyTorch models are skipped (optional: maybe installing pytorch can fix it). [290722:MainThread](2025-05-06 19:00:22,751) INFO - qlib.timer - [log.py:127] - Time cost: 18.270s | Loading data Done /home/roger/anaconda3/envs/qlib_test/lib/python3.10/site-packages/numpy/lib/_nanfunctions_impl.py:1233: RuntimeWarning: All-NaN slice encountered return fnb._ureduce(a, func=_nanmedian, keepdims=keepdims, [290722:MainThread](2025-05-06 19:00:33,364) INFO - qlib.timer - [log.py:127] - Time cost: 8.424s | RobustZScoreNorm Done [290722:MainThread](2025-05-06 19:00:35,410) INFO - qlib.timer - [log.py:127] - Time cost: 2.046s | Fillna Done [290722:MainThread](2025-05-06 19:00:39,221) INFO - qlib.timer - [log.py:127] - Time cost: 0.752s | DropnaLabel Done /home/roger/anaconda3/envs/qlib_test/lib/python3.10/site-packages/qlib/data/dataset/processor.py:363: SettingWithCopyWarning: A value is trying to be set on a copy of a slice from a DataFrame. Try using .loc[row_indexer,col_indexer] = value instead
See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy
df[cols] = t
[290722:MainThread](2025-05-06 19:00:39,919) INFO - qlib.timer - [log.py:127] - Time cost: 0.698s | CSRankNorm Done
[290722:MainThread](2025-05-06 19:00:39,923) INFO - qlib.timer - [log.py:127] - Time cost: 17.172s | fit & process data Done
[290722:MainThread](2025-05-06 19:00:39,924) INFO - qlib.timer - [log.py:127] - Time cost: 35.443s | Init data Done
[290722:MainThread](2025-05-06 19:00:39,924) WARNING - qlib.utils - [init.py:849] - The parameter reweighter with value None is ignored.
[290722:MainThread](2025-05-06 19:00:41,360) INFO - qlib.timer - [log.py:127] - Time cost: 0.000s | waiting async_log Done
[290722:MainThread](2025-05-06 19:00:41,361) ERROR - qlib.workflow - [utils.py:41] - An exception has been raised[TypeError: mean() got an unexpected keyword argument 'level'].
File "/home/roger/anaconda3/envs/qlib_test/bin/qrun", line 8, in
seems the highfreq model has some problem
Expected Behavior
Screenshot
Environment
Note: User could run cd scripts && python collect_info.py all under project directory to get system information
and paste them here directly.
- Qlib version:
- Python version:
- OS (
Windows,Linux,MacOS): - Commit number (optional, please provide it if you are using the dev version):
Additional Notes
Hi, @andy071001
TypeError: mean() got an unexpected keyword argument 'level'
Series.mean(level=0), which has been removed or is no longer recommended in newer versions of Pandas.
This has been fixed in PR 1917, and has now been merged, so please pull the latest main branch code and retry.