我的报错是 AttributeError: 'DataFrame' object has no attribute 'append'
时间: 2023-08-05 09:06:53 浏览: 259
在你的代码中,出现了AttributeError: 'DataFrame' object has no attribute 'append'的错误。这是因为在不同的pandas版本中,DataFrame的相关属性已过期,不再推荐使用。解决这个问题的方法是使用pd.concat()函数来代替append()方法。你可以将代码改成以下形式:df = pd.concat(\[df, pd.DataFrame(\[res\])\], ignore_index=True)。这样就可以避免使用已过期的append方法而引发错误了。\[2\]
#### 引用[.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^v91^insertT0,239^v3^insert_chatgpt"}} ] [.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^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item]
- *3* [python常见报错01 AttributeError: 'NoneType' object has no attribute 'append'](https://blog.csdn.net/qq_36564503/article/details/103745419)[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^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item]
[ .reference_list ]
阅读全文