[英]read xlsx file with sheet named as None. pandas xlrd
我有一堆xlsx文件,它们的工作表名为None
(空字符串)
当我尝试使用pandas
读取文件时, xlrd
引发list index out of range
错误。
Traceback (most recent call last):
File "/usr/local/bin/runxlrd.py", line 332, in main
ragged_rows=options.ragged_rows,
File "/Library/Python/2.7/site-packages/xlrd/__init__.py", line 416, in open_workbook
ragged_rows=ragged_rows,
File "/Library/Python/2.7/site-packages/xlrd/xlsx.py", line 791, in open_workbook_2007_xml
x12sheet.process_stream(zflo, heading)
File "/Library/Python/2.7/site-packages/xlrd/xlsx.py", line 528, in own_process_stream
self_do_row(elem)
File "/Library/Python/2.7/site-packages/xlrd/xlsx.py", line 667, in do_row
value = self.sst[int(tvalue)]
IndexError: list index out of range
我发现这个发行xrld
github上,我认为是相关的。
如果我更改工作表的名称, pandas
成功读取文件。
我不能以共享文件为例(隐私问题),当我尝试创建一个以工作表名称为None
的演示文件时,Excel引发了无效的名称错误。
软件包版本。
pkg_resources.get_distribution("xlrd").version
Out[3]: '1.1.0'
pd.__version__
Out[4]: '0.23.0'
有没有办法使用大熊猫或可以更改工作表名称的脚本(任何语言)读取此文件?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.