Problem description: Xlsx is not saving the spreadsheet correctly somehow. Python pandas errors when I do the following steps.
Steps to reproduce:
1. create an ods file with several columns
2. save ods file as xslx
3. in the xslx, delete some columns from the end
4. try to import it using df=pd.read_excel (pandas); get error.
Current behavior: If we right click and delete entire columns from the LO gui, we get the error. If we just hand delete the cells, there is no error.
Error from pandas:
AssertionError Traceback (most recent call last)
<ipython-input-34-44faaa7b5381> in <module>()
1 file = "a.xlsx"
----> 2 df=pd.read_excel(file, 'a', index_col=0)
/usr/lib/python2.7/dist-packages/pandas/io/excel.pyc in read_excel(io, sheetname, **kwds)
111 engine = kwds.pop('engine', None)
--> 113 return ExcelFile(io, engine=engine).parse(sheetname=sheetname, **kwds)
/usr/lib/python2.7/dist-packages/pandas/io/excel.pyc in __init__(self, io, **kwds)
148 self.book = xlrd.open_workbook(file_contents=data)
--> 150 self.book = xlrd.open_workbook(io)
151 elif engine == 'xlrd' and isinstance(io, xlrd.Book):
152 self.book = io
/usr/lib/python2.7/dist-packages/xlrd/__init__.pyc in open_workbook(filename, logfile, verbosity, use_mmap, file_contents, encoding_override, formatting_info, on_demand, ragged_rows)
--> 416 ragged_rows=ragged_rows,
418 return bk
/usr/lib/python2.7/dist-packages/xlrd/xlsx.pyc in open_workbook_2007_xml(zf, component_names, logfile, verbosity, use_mmap, formatting_info, on_demand, ragged_rows)
752 x12sheet = X12Sheet(sheet, logfile, verbosity)
753 heading = "Sheet %r (sheetx=%d) from %r" % (sheet.name, sheetx, fname)
--> 754 x12sheet.process_stream(zflo, heading)
755 del zflo
/usr/lib/python2.7/dist-packages/xlrd/xlsx.pyc in own_process_stream(self, stream, heading)
521 elem.clear() # destroy all child elements (cells)
522 elif elem.tag == U_SSML12 + "dimension":
--> 523 self.do_dimension(elem)
/usr/lib/python2.7/dist-packages/xlrd/xlsx.pyc in do_dimension(self, elem)
529 # print >> self.logfile, "dimension: ref=%r" % ref
530 last_cell_ref = ref.split(':')[-1] # example: "Z99"
--> 531 rowx, colx = cell_name_to_rowx_colx(last_cell_ref)
532 self.sheet._dimnrows = rowx + 1
533 self.sheet._dimncols = colx + 1
/usr/lib/python2.7/dist-packages/xlrd/xlsx.pyc in cell_name_to_rowx_colx(cell_name, letter_value)
87 else: # start of row number; can't be '0'
88 colx = colx - 1
---> 89 assert 0 <= colx < X12_MAX_COLS
91 except KeyError:
Expected behavior: Should be no error.
Thank you for filing the bug. Please send us a sample document, as this makes it easier for us to verify the bug.
I have set the bug's status to 'NEEDINFO', so please do change it back to 'UNCONFIRMED' once you have attached a document.
(Please note that the attachment will be public, remove any sensitive information before attaching it.)
How can I eliminate confidential data from a sample document?
Are you sure it's not pandas bug? I tried your steps with LO 4.3.2 and excel2010 and no error seen.
Dear Bug Submitter,
This bug has been in NEEDINFO status with no change for at least
6 months. Please provide the requested information as soon as
possible and mark the bug as UNCONFIRMED. Due to regular bug
tracker maintenance, if the bug is still in NEEDINFO status with
no change in 30 days the QA team will close the bug as INVALID
due to lack of needed information.
For more information about our NEEDINFO policy please read the
wiki located here:
If you have already provided the requested information, please
mark the bug as UNCONFIRMED so that the QA team knows that the
bug is ready to be confirmed.
Thank you for helping us make LibreOffice even better for everyone!
This NEEDINFO Message was generated on: 2015-06-08
Dear Bug Submitter,
Please read this message in its entirety before proceeding.
Your bug report is being closed as INVALID due to inactivity and a lack of information which is needed in order to accurately reproduce and confirm the problem. We encourage you to retest your bug against the latest release. If the issue is still present in the latest stable release, we need the following information (please ignore any that you've already provided):
a) Provide details of your system including your operating system and the latest version of LibreOffice that you have confirmed the bug to be present
b) Provide easy to reproduce steps – the simpler the better
c) Provide any test case(s) which will help us confirm the problem
d) Provide screenshots of the problem if you think it might help
e) Read all comments and provide any requested information
Once all of this is done, please set the bug back to UNCONFIRMED and we will attempt to reproduce the issue.
Please do not:
a) respond via email
b) update the version field in the bug or any of the other details on the top section of FDO
Message generated on: 2015-07-18