BUG: Styler.hide_columns()
does not hide index name row · Issue #42101 · pandas-dev/pandas (original) (raw)
Navigation Menu
- Explore
- Pricing
Provide feedback
Saved searches
Use saved searches to filter your results more quickly
Appearance settings
Description
Whilst Styler.hide_index()
hides column header name (along with the index), the index name row persists when Styler.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:
- Find
pandas/io/formats/style_render.py
- Find the method for the
StyleRenderer
called_translate_header
and read the documentation what it is trying to structure. - Go to the section in the method labelled
# 2
and insertself.hide_columns_
into the conditional. - Add a test to
pandas/tests/io/formats/style/test_style.py
that addresses this.