-
-
Notifications
You must be signed in to change notification settings - Fork 18k
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
read_excel gives different data for one and more than one elements in parse_cols setting #15316
Comments
easier to read example
[9] does look buggy. |
@chris-b1 as you seem to be the latent excel expert! also, IIRC we had an issue to |
xref #4988 for Personally, I never use |
I'm taking a stab at this (from PyCon Sprint). |
From discussion on gitter: this is caused by the fact that the TextParser by default skips empty lines. This is also the default behaviour of
So possible options to go forward here:
|
@jorisvandenbossche Thanks for moving the conversation over. Some more illustration with TextParser:
|
It seems like
|
Actually, since
|
Yes, that looks like a good way to go. |
Deferring the logic to |
Yes, that's fine - because of the way excel data is structured (row oriented XML) the whole file has to be parsed anyways - it might add a little overhead, but small relative to overall reading time. df = pd.DataFrame(np.random.randn(1000, 10), columns=list('qwertyuasd'))
df.to_excel('tmp.xlsx', index=False)
%timeit pd.read_excel('tmp.xlsx')
10 loops, best of 3: 111 ms per loop
%timeit pd.read_excel('tmp.xlsx', parse_cols='a')
10 loops, best of 3: 104 ms per loop |
Not sure when this was patched, but we extensively test Closing. |
related to #12292
Try to get values from only first column with empty cells
Different view of read the same column:
Whether output for first column must be the same for both cases, for generalization of reading data?
How can I get full data (included empty values) from first column using parse_cols=[0]?
Expected Output
pandas: 0.18.1
xlrd: 0.9.4
python: 2.7.7.final.0
The text was updated successfully, but these errors were encountered: