SettingWithCopyWarning: in using pandas 的警告信息

问题描述

在使用 pandas 更新数据框时,我收到以下警告消息。我不清楚这些警告消息表明什么?提供的链接讨论了链索引,我不确定这与这些代码段有什么关系。

df_train.fillna(df_train.mean(),inplace=True)

C:\Users\Anaconda3\envs\tensorflow\lib\site-packages\pandas\core\series.py:4523: SettingWithcopyWarning: 
A value is trying to be set on a copy of a slice from a DataFrame

See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy
  downcast=downcast,for column in columns_to_delete:
    df_train.drop(column,axis=1,inplace=True)

C:\Users\Anaconda3\envs\tensorflow\lib\site-packages\pandas\core\frame.py:4170: SettingWithcopyWarning: 
A value is trying to be set on a copy of a slice from a DataFrame

See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy
  errors=errors,

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)