I am trying to read several excel files using pd.read_excel. However, there is error:
UnicodeDecodeError: 'utf-16-le' codec can't decode bytes in position 114-115: unexpected end of data
.
So I tried to add encoding = "latin1"
and here is the error: TypeError: read_excel() got an unexpected keyword argument 'encoding'
.
When I saved xls as csv using Excel and then read csv with encoding="latin1"
it works. However, I want to read xls directly without converting to csv. Is it possible to fix this issue? Thank you.
Edited: the importing works if using xlsx rather than xls.