s.io.formats.style.Styler.set_uuid ](pandas.io.formats.style.Styler.set_uuid.html)
    * [ pandas.io.formats.style.Styler.clear ](pandas.io.formats.style.Styler.clear.html)
    * [ pandas.io.formats.style.Styler.pipe ](pandas.io.formats.style.Styler.pipe.html)
    * [ pandas.io.formats.style.Styler.highlight_null ](pandas.io.formats.style.Styler.highlight_null.html)
    * [ pandas.io.formats.style.Styler.highlight_max ](pandas.io.formats.style.Styler.highlight_max.html)
    * [ pandas.io.formats.style.Styler.highlight_min ](pandas.io.formats.style.Styler.highlight_min.html)
    * [ pandas.io.formats.style.Styler.highlight_between ](pandas.io.formats.style.Styler.highlight_between.html)
    * [ pandas.io.formats.style.Styler.highlight_quantile ](pandas.io.formats.style.Styler.highlight_quantile.html)
    * [ pandas.io.formats.style.Styler.background_gradient ](pandas.io.formats.style.Styler.background_gradient.html)
    * [ pandas.io.formats.style.Styler.text_gradient ](pandas.io.formats.style.Styler.text_gradient.html)
    * [ pandas.io.formats.style.Styler.bar ](pandas.io.formats.style.Styler.bar.html)
    * [ pandas.io.formats.style.Styler.to_html ](pandas.io.formats.style.Styler.to_html.html)
    * [ pandas.io.formats.style.Styler.to_latex ](pandas.io.formats.style.Styler.to_latex.html)
    * [ pandas.io.formats.style.Styler.to_excel ](pandas.io.formats.style.Styler.to_excel.html)
    * [ pandas.io.formats.style.Styler.to_string ](pandas.io.formats.style.Styler.to_string.html)
    * [ pandas.io.formats.style.Styler.export ](pandas.io.formats.style.Styler.export.html)
    * [ pandas.io.formats.style.Styler.use ](pandas.io.formats.style.Styler.use.html)
  * [ Plotting ](../plotting.html)
  * [ Options and settings ](../options.html)
  * [ Extensions ](../extensions.html)
  * [ Testing ](../testing.html)
  * [ Missing values ](../missing_value.html)

  * [ __ ](../../index.html)
  * [ API reference ](../index.html)
  * [ Style ](../style.html)
  * pandas.io.fo... 

#  pandas.io.formats.style.Styler.relabel_index  #

Styler.  relabel_index  (  _ labels  _ , _ axis  =  0  _ , _ level  =  None  _
)  [ [source]  ](https://github.com/pandas-
dev/pandas/blob/v2.2.2/pandas/io/formats/style_render.py#L1403-L1559) #

    

Relabel the index, or column header, keys to display a set of specified
values.

New in version 1.5.0.

Parameters  :

    

**labels** list-like or Index

    

New labels to display. Must have same length as the underlying values not
hidden.

**axis** {âindexâ, 0, âcolumnsâ, 1}

    

Apply to the index or columns.

**level** int, str, list, optional

    

The level(s) over which to apply the new labels. If  None  will apply to all
levels of an Index or MultiIndex which are not hidden.

Returns  :

    

Styler

    

See also

[ ` Styler.format_index  `
](pandas.io.formats.style.Styler.format_index.html#pandas.io.formats.style.Styler.format_index
"pandas.io.formats.style.Styler.format_index")

    

Format the text display value of index or column headers.

[ ` Styler.hide  `
](pandas.io.formats.style.Styler.hide.html#pandas.io.formats.style.Styler.hide
"pandas.io.formats.style.Styler.hide")

    

Hide the index, column headers, or specified data from display.

Notes

As part of Styler, this method allows the display of an index to be completely
user-specified without affecting the underlying DataFrame data, index, or
column headers. This means that the flexibility of indexing is maintained
whilst the final display is customisable.

Since Styler is designed to be progressively constructed with method chaining,
this method is adapted to react to the **currently specified hidden elements**
. This is useful because it means one does not have to specify all the new
labels if the majority of an index, or column headers, have already been
hidden. The following produce equivalent display (note the length of ` labels
` in each case).

    
    
    # relabel first, then hide
    df = pd.DataFrame({"col": ["a", "