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

Columns Index Name with to_html(index_names=False) is displayed. #22747

Closed
simonjayhawkins opened this issue Sep 18, 2018 · 1 comment · Fixed by #22655
Closed

Columns Index Name with to_html(index_names=False) is displayed. #22747

simonjayhawkins opened this issue Sep 18, 2018 · 1 comment · Fixed by #22655
Labels
Bug IO HTML read_html, to_html, Styler.apply, Styler.applymap
Milestone

Comments

@simonjayhawkins
Copy link
Member

Code Sample

df = pd.DataFrame(np.zeros((2, 2), dtype=int))
df.columns.name = 'columns.name'
df.to_html(index_names=False)

Output

columns.name 0 1
0 0 0
1 0 0

Problem description

from the docs:

index_names : bool, optional
Prints the names of the indexes, default True

The problem occurs with both standard and MultiIndex columns index. The expected behavior is observed on the (row) Index, if it has names they are not displayed.

Expected Output

0 1
0 0 0
1 0 0

Output of pd.show_versions()

[paste the output of pd.show_versions() here below this line]

@simonjayhawkins
Copy link
Member Author

currently fixed in #22655, but separate PR to follow.

@gfyoung gfyoung added Bug IO HTML read_html, to_html, Styler.apply, Styler.applymap labels Sep 23, 2018
@jreback jreback added this to the 0.24.0 milestone Nov 19, 2018
@jreback jreback modified the milestones: 0.24.0, Contributions Welcome Dec 2, 2018
@jreback jreback modified the milestones: Contributions Welcome, 0.24.0 Dec 28, 2018
thoo added a commit to thoo/pandas that referenced this issue Jan 1, 2019
* upstream/master:
  BUG: output formatting with to_html(), index=False and/or index_names=False (pandas-dev#22579, pandas-dev#22747) (pandas-dev#22655)
  MAINT: Port _timelex in codebase (pandas-dev#24520)
  Implement unique+array parts of 24024 (pandas-dev#24527)
  Integer NA docs (pandas-dev#23617)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug IO HTML read_html, to_html, Styler.apply, Styler.applymap
Projects
None yet
3 participants