英文:
python pandas read_excel(filename) but i found '~$' before the real filename
问题
df_512g = pd.read_excel(resource_file, sheet_name=0, header=None, names=header_name, skiprows=6, usecols=encols_512g)
and printout is:
>debug: C:\Users\Datalog\~$ID byte.xlsx
> Traceback (most recent call last):
> xlrd.biffh.XLRDError: 不支持的格式或损坏的文件:预期的BOF记录;找到
英文:
code:
df_512g = pd.read_excel(resource_file, sheet_name=0, header=None,names=header_name, skiprows=6, usecols=encols_512g)
and printout is:
>debug: C:\Users\Datalog~$ID byte.xlsx
> Traceback (most recent call last):
> xlrd.biffh.XLRDError: Unsupported format, or corrupt file: Expected BOF record; found
答案1
得分: 0
尽管我忘记了我何时打开Excel文件并且没有正确保存它,因此在Python控制台中留下了一个临时文件,其文件名在真实文件名之前带有~$。
解决方法是创建一个新文件夹并将新文件添加到其中。这有效。
英文:
Though i forgot when i open the excel file and didn't save it correctly, so left a temporary file which occurs in python console with ~$ before the real file name.
Solution is create a new folder and add new file into it. It works.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论