读取Quickbooks Excel文件时出现Pandas read_excel错误-ValueError:没有足够的值可解压缩

时间:2019-02-08 17:29:16

标签: python pandas quickbooks

当尝试读取从Quickbooks导出的excel文件时,出现“ ValueError:没有足够的值要解压(预期2,得到1)”。我的文件只有一个标签,而我看不到的任何地方都没有合并的单元格。如果我删除第一列,则可以打开它。我碰巧能够删除此文件中的第一列,但是每次都必须这样做很麻烦,所以我想弄清楚发生了什么。我在其他QB导出文件上也看到这种错误。

pd.read_excel(rcvFile)

Traceback (most recent call last):

  File "<ipython-input-265-0f09a2193be4>", line 1, in <module>
    pd.read_excel(rcvFile)

  File "/Users/claudiahertzog/anaconda/lib/python3.6/site-packages/pandas/util/_decorators.py", line 188, in wrapper
    return func(*args, **kwargs)

  File "/Users/claudiahertzog/anaconda/lib/python3.6/site-packages/pandas/util/_decorators.py", line 188, in wrapper
    return func(*args, **kwargs)

  File "/Users/claudiahertzog/anaconda/lib/python3.6/site-packages/pandas/io/excel.py", line 350, in read_excel
    io = ExcelFile(io, engine=engine)

  File "/Users/claudiahertzog/anaconda/lib/python3.6/site-packages/pandas/io/excel.py", line 653, in __init__
    self._reader = self._engines[engine](self._io)

  File "/Users/claudiahertzog/anaconda/lib/python3.6/site-packages/pandas/io/excel.py", line 424, in __init__
    self.book = xlrd.open_workbook(filepath_or_buffer)

  File "/Users/claudiahertzog/anaconda/lib/python3.6/site-packages/xlrd/__init__.py", line 422, in open_workbook
    ragged_rows=ragged_rows,

  File "/Users/claudiahertzog/anaconda/lib/python3.6/site-packages/xlrd/xlsx.py", line 833, in open_workbook_2007_xml
    x12sheet.process_stream(zflo, heading)

  File "/Users/claudiahertzog/anaconda/lib/python3.6/site-packages/xlrd/xlsx.py", line 553, in own_process_stream
    self.do_merge_cell(elem)

  File "/Users/claudiahertzog/anaconda/lib/python3.6/site-packages/xlrd/xlsx.py", line 609, in do_merge_cell
    first_cell_ref, last_cell_ref = ref.split(':')

ValueError: not enough values to unpack (expected 2, got 1)

0 个答案:

没有答案