0
点赞
收藏
分享

微信扫一扫

FutureWarning: pandas.Int64Index is deprecated and will be removed ... in a future version. 解决方法


调用 XGBoost 时遇到如下 FutureWarning:

compat.py:36: FutureWarning: pandas.Int64Index is deprecated and will be removed from pandas in a future version. Use pandas.Index with the appropriate dtype instead.
from pandas import MultiIndex, Int64Index


data.py:267: FutureWarning: pandas.Int64Index is deprecated and will be removed from pandas in a future version. Use pandas.Index with the appropriate dtype instead.
elif isinstance(data.columns, (pd.Int64Index, pd.RangeIndex)):

我的解决方法:

pip uninstall pandas
pip install pandas==1.3

其他解决方案说降低 xgboost 的版本,或者先导入 MultiIndex, Int16Dtype,如下所示:

import pandas as pd 
from pandas import MultiIndex, Int16Dtype
import xgboost as

  • ​​stackoverflow | pandas.Int64Index fix for FutureWarning​​
  • ​​编程技术网 | Pandas.Int64Index被弃用:pandas.Int64Index is deprecated​​


举报

相关推荐

0 条评论