成功解决pandas\core\indexing.py:179: SettingWithCopyWarning: A value is trying to be set on a copy of a

成功解决pandas\core\indexing.py:179: SettingWithCopyWarning:  A value is trying to be set on a copy of a


解决问题

pandas\core\indexing.py:179: SettingWithCopyWarning: 
A value is trying to be set on a copy of a slice from a DataFrame

解决思路

错误地址:pandas\core\indexing.py:179
设置复制警告:试图在DataFrame切片的副本上设置一个值

See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html   #indexing-view-versus-copy
  self._setitem_with_indexer(indexer, value)

解决方法

此信息提示为警告,而不是error,即使不处理也不会影响代码编程的运行。如果想要去掉,可以更新库至最新版本!
然后根据要求提示修改使用方法!
在进行 a copy of a slice from a DataFrame时,该方法不再推荐使用!需要从http://pandas.pydata.org/pandas-docs/stable/indexing.html 文档查看最新的调用方法!

(0)

相关推荐