如何修复大小超出python 3中的预期 [英] How to fix size exceeds expected in python 3
问题描述
我正在尝试使用python pandas
遍历Excel文件.首先,我将它们保存到csv,然后再次打开它们,切片,然后再次保存.但我收到一个错误:
I am trying to loop over Excel files with python pandas
. First I'm saving them to csv and then I open them again, slice and then saving them again. But I get an error:
"Workbook: size exceeds expected 10752 bytes; corrupt?"
我对python比较陌生.
I am relatively new to python.
推荐答案
我可以通过在Excel中打开有问题的Excel文件并直接保存来修复此确切错误.
I could fix this exact error by just opening the problematic Excel file in Excel and simply saving it.
之后,我可以将文件导入Pandas中而不会出现错误.
After that I could import the file in Pandas without the error.
就我而言,我怀疑此错误是由Windows(生成我的源文件的地方)和Mac OS(我导入文件的地方)之间的Excel平台不一致导致的.
In my case I suspect that this error results from a platform inconsistancy in Excel between Windows (where my source files were generated) and Mac OS (where I import the files).
这篇关于如何修复大小超出python 3中的预期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!