尝试将文件保存到 CSV 时遇到此错误
AttributeError: 'Index' object has no attribute '_format_native_types'
。它可以正确保存在 XLSX 中。我重新安装电脑后就开始出现这种情况,之前运行得很好。
我尝试了 chatgpt 并得到了here's a problem with how Pandas is trying to handle the index of your DataFrame during the CSV export process.
建议dataset.reset_index(drop=True, inplace=True)
但这并没有解决问题。
重启电脑后问题解决。不确定原因。