AttributeError: 'DataFrame' object has no attribute 'append'
时间: 2023-08-14 08:03:38 浏览: 310
Python3下错误AttributeError: ‘dict’ object has no attribute’iteritems‘的分析与解决
5星 · 资源好评率100%
回答: 这个错误是由于在较新版本的pandas中,DataFrame对象不再具有append属性导致的。可以将代码改成使用concat函数来实现相同的功能,例如:df = pd.concat([df, pd.DataFrame([res])], ignore_index=True)。另外,为了避免这个错误,你可以查看官方文档了解更多关于DataFrame的方法和属性的信息。<em>1</em><em>2</em><em>3</em>
#### 引用[.reference_title]
- *1* [已解决:pandas报AttributeError: DataFrame object has no attribute ix错误](https://blog.csdn.net/mahoon411/article/details/118917335)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}} ] [.reference_item]
- *2* [AttributeError: ‘DataFrame‘ object has no attribute ‘append‘ 解决方案](https://blog.csdn.net/dream6985/article/details/130760284)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}} ] [.reference_item]
- *3* [莫烦强化学习Q-learning例子遇到BUG:AttributeError: ‘DataFrame‘ object has no attribute ‘ix‘问题...](https://blog.csdn.net/qq_42750982/article/details/123781149)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}} ] [.reference_item]
[ .reference_list ]
阅读全文