-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
'ascii' codec can't decode byte 0xd1 in position 2: ordinal not in range(128) #23444
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
That seems reasonable to me. We have an encoding parameter in |
Is this only applicable to files created with Excel 95 and earlier? https://xlrd.readthedocs.io/en/latest/unicode.html If so I am -1 here as I can't imagine we support anything else explicitly with that type of age to it |
@WillAyd : Consistency with |
Am I misreading it that all Excel files created in the past 21 years contain an encoding of utf-16-le though? If so while consistency is good the keyword would either be unused or actually confusing / counter-productive to almost every Excel file still out there in the wild. |
Uncertain.
Confusing? Not if good documentation is written for it. Would be good then to clarify |
My big pushback is on referring to this as What if we just either changed the intention here to add |
@WillAyd : I'm not sure I fully understand your argument. The word "encoding" seems to mean the same thing for |
I don't know exactly what kind of file it is, since it's from one of our users (I don't know how he generated the file). The thing is that xlrd does support it and, thus, I thought that read_excel, since it uses xlrd, should be prepare, being it with encoding parameter or kwargs, to account for that scenario. |
Am facing the same issue when i try to export my pandas dataframe to an excel file, so the issue is still open for that as well ? |
@sindhusubha : Absolutely |
Code Sample, a copy-pastable example if possible
Problem description
I'm trying to read a xls file with
read_excel()
method and it throws the error on the title. If I try to read the file with xlrd lib I can fix the error by providing the parameterencoding_override
with the file encoding. I've seen some Stackoverflow answers and all of them recommend using anencoding
parameter, which doesn't exist. Why don't the implement an encoding parameter for theread_excel()
method, and just use it asencoding_override
when reading the file with xlrd?The text was updated successfully, but these errors were encountered: