-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: misplaced index_label with DF.to_excel() #6260
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
I'm not familiar with this part of the code base, but it looks like placing the index_label in the second row was intentional, probably to mimic the output in the terminal. The problem here seems to be that if From the docstring:
Could we keep the current behavior of |
@iled as a workaround for now, you can use the skiprows keyword in |
@TomAugspurger you think this is a bug? |
I guess that treating If it is intentional that the index_label is written in the 2nd row, then I would consider that a regression. I would say that more important than mimicking the output in the terminal, is to keep consistency. Here are two reasons:
|
|
IIRC he did a lot of the ofiginal to_excel stuff. I though cc @locojay |
#2370 -> #2396 (comment) -> #5423 cc @jmcnamara |
There are a few issues involved here and I'll try to keep them separate. GitHub's lack of threads in long discussions like this is a pain. :-(
|
Thanks for the explanation. I don't think I see the |
I appreciate your help, jmcnamara. That was really helpful. The problem here is like TomAugspurger said: there is a lack of documentation. I would consider this issue closed. Thank you all |
does anyone want to update the doc string / io.rst or just close? |
I never used Sphinx nor reST, but I want to, so I can try and update the doc strings and other documentation. |
Since the docs have been updated, and everyone seems happy, can we close this? |
I thought it was already closed as my commit have been merged. |
depending on how things r merged sometimes the ref issue is not auto closed |
When saving an excel file from a DataFrame with the method to_excel, there is a misbehaviour with index_label: it is placed in the 2nd row.
For instance
Produces the following result within the xls file:
Even if I force index_label=None, the behaviour persists
Which is written as
This is a problem because then I can't read the same DF after I write it:
I'm using pandas 0.13.0. In version 0.12 the label index was inserted in the first row.
The text was updated successfully, but these errors were encountered: