Skip to content
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

Named DataFrame indices shouldn't introduce an empty row between header and data #43

Open
fzumstein opened this issue Oct 16, 2023 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@fzumstein
Copy link

fzumstein commented Oct 16, 2023

When showing Values of a DataFrame with a named index, it introduces an empty row between header and data. There's no reason for it though, and pd.to_excel() doesn't do it either (even if there's additionally a df.columns.name!). So currently, you'd have to do df.reset_index() to format it correctly.
Screenshot 2023-10-16 at 4 35 02 PM

@keyur32 keyur32 self-assigned this Oct 17, 2023
@keyur32 keyur32 added the bug Something isn't working label Oct 17, 2023
@keyur32
Copy link
Collaborator

keyur32 commented Oct 17, 2023

Thanks for the report, I agree I'd expect not to have a blank row in this case as well (might be a regression). Marking as a bug so we can follow up with the team

@KimJun9011
Copy link

df - with extra space
If you try the same example on standard jupyter environment, you will see the exact same space allocated. I do not see this as an issue.

@fzumstein
Copy link
Author

That's right, because Jupyter notebooks leave space for a potential columns name, but that concept doesn't really translate to Excel (see e.g., Excel tables).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants