-
-
Notifications
You must be signed in to change notification settings - Fork 18.2k
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
BUG: Styler.hide_columns()
does not hide index name row
#42101
Comments
take |
Can a user not call |
if Note the difference between the name of the index, and the actual index-label values. |
Hi @attack68, Can you please give an example for better understanding of this issue. |
@attack68 this already seems to be the case for me on the master branch
am I missing something? |
Hi @skvrahul how did you get the dataframe as an output after executing this line "df.style.hide_columns()" . For me its returning a styler object. Did u typecast? If yes, how? |
Running it in a Jupyter Notebook should output a table by rendering the underlying HTML. |
@skvrahul @raghuabhishek you both seem to be confused by the name of an index and the values of an index, be it, a row-index or a column-index. The mentioned documentation in the OP should clarify this also, but here is a screenshot of the issue on master: |
Yeah this clears things up. Thanks! Looks like I missed naming the index in my example, which threw me off. |
Whilst
Styler.hide_index()
hides column header name (along with the index), the index name row persists whenStyler.hide_columns()
is used to hide column headers.The index names rows should also be hidden, since currently there is no way to hide it independently.
What to do:
pandas/io/formats/style_render.py
StyleRenderer
called_translate_header
and read the documentation what it is trying to structure.# 2
and insertself.hide_columns_
into the conditional.pandas/tests/io/formats/style/test_style.py
that addresses this.The text was updated successfully, but these errors were encountered: