-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: read_excel doesn't respect string data #11331
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
xref #8212 this should be done via the dtype kw (and not s converter) as it's more consistent with how the other parsers work and it should be coercing normally as that is the expected behavior |
I guess my point is that (unlike csv, etc) Excel numeric data will already be de-serialized as a python numeric type, so the only data that will be strings are those explicitly stored as strings in Excel. So a different default could make sense? |
zipcodes are usually stored as integers with a format |
Right, if that were the case I think the data should still be read as integers. In this case the zipcodes were stored as Excel text (i.e. if you typed In [25]: ws = xlrd.open_workbook('test.xlsx').sheet_by_index(0)
In [26]: ws.cell_value(1, 0)
Out[26]: 55.0
In [27]: ws.cell_value(2, 0)
Out[27]: u'00500' |
ok then might be a bug then |
Zipcodes are usually stored as strings. You also have zip+4 which also need to be stored as strings e.g. 32771-5407 |
dupe of #8212 |
From SO
I think it would probably make sense for
read_excel
to not try and convert strings to numeric, or at least have another keyword argument.The text was updated successfully, but these errors were encountered: