Been banging my head with this error for a few hours now.
I am trying to read a xlxs file with pandas but i am running through this error.
TypeError: CellStyle.init() got an unexpected keyword argument ‘applyFillId’
Here is the code:
df = pd.read_excel(input_file, sheet_name=_sheetname, skiprows=10, usecols=5, names=_columnnames)
df = pd.read_excel(input_file, sheet_name=_sheetname, skiprows=10, usecols=5, names=_columnnames)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “C:Usersmtimothevenv_newLibsite-packagespandasioexcel_base.py”, line 495, in read_excel
io = ExcelFile(
^^^^^^^^^^
File “C:Usersmtimothevenv_newLibsite-packagespandasioexcel_base.py”, line 1567, in init
self._reader = self._engines[engine](
^^^^^^^^^^^^^^^^^^^^^^
File “C:Usersmtimothevenv_newLibsite-packagespandasioexcel_openpyxl.py”, line 553, in init
super().init(
File “C:Usersmtimothevenv_newLibsite-packagespandasioexcel_base.py”, line 573, in init
self.book = self.load_workbook(self.handles.handle, engine_kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “C:Usersmtimothevenv_newLibsite-packagespandasioexcel_openpyxl.py”, line 572, in load_workbook
return load_workbook(
^^^^^^^^^^^^^^
File “C:Usersmtimothevenv_newLibsite-packagesopenpyxlreaderexcel.py”, line 348, in load_workbook
reader.read()
File “C:Usersmtimothevenv_newLibsite-packagesopenpyxlreaderexcel.py”, line 301, in read
apply_stylesheet(self.archive, self.wb)
File “C:Usersmtimothevenv_newLibsite-packagesopenpyxlstylesstylesheet.py”, line 213, in apply_stylesheet
stylesheet = Stylesheet.from_tree(node)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File “C:Usersmtimothevenv_newLibsite-packagesopenpyxlstylesstylesheet.py”, line 105, in from_tree
return super(Stylesheet, cls).from_tree(node)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “C:Usersmtimothevenv_newLibsite-packagesopenpyxldescriptorsserialisable.py”, line 87, in from_tree
obj = desc.expected_type.from_tree(el)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “C:Usersmtimothevenv_newLibsite-packagesopenpyxldescriptorsserialisable.py”, line 87, in from_tree
obj = desc.expected_type.from_tree(el)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “C:Usersmtimothevenv_newLibsite-packagesopenpyxldescriptorsserialisable.py”, line 103, in from_tree
return cls(**attrib)
^^^^^^^^^^^^^
TypeError: CellStyle.init() got an unexpected keyword argument ‘applyFillId’
I tried specifying the engine in the parameter to openpyxl but gets the same error.
I expected to get a dataframe that reads the excel file with the specified columns and rows
Timothee Muzaliwa is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.