BUG: Styler.hide_columns() does not hide index name row · Issue #42101 · pandas-dev/pandas (original) (raw)

Skip to content

Provide feedback

Saved searches

Use saved searches to filter your results more quickly

Sign up

Appearance settings

@attack68

Description

@attack68

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:

  1. Find pandas/io/formats/style_render.py
  2. Find the method for the StyleRenderer called _translate_header and read the documentation what it is trying to structure.
  3. Go to the section in the method labelled # 2 and insert self.hide_columns_ into the conditional.
  4. Add a test to pandas/tests/io/formats/style/test_style.py that addresses this.