微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

SettingWithCopyWarning: in using pandas 的警告信息

如何解决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 举报,一经查实,本站将立刻删除。