pandas.io.formats.style.Styler.format_index_names

pandas 3.1.1 · Styling · method

Set how the names of the index or columns are displayed.

Call syntax

Styler.format_index_names(…) Full signature
Styler.format_index_names(
    formatter=None,
    axis=0,
    level=None,
    na_rep=None,
    precision=None,
    decimal='.',
    thousands=None,
    escape=None,
    hyperlinks=None,
)

Run the example

Edit the example and select Run Python to see the result.

Parameters

ParameterRequirementAccepted values and behavior
formatter Optional
Positional or keyword
Default None
str, callable, dict or None

Provide the formatting rule applied to the selected values or labels.

axis Optional
Positional or keyword
Default 0
{0, "index", 1, "columns"}

Choose which axis the operation acts on. The accepted axis labels depend on the receiver.

level Optional
Positional or keyword
Default None
int, str, list

Choose an index level by name or integer position.

na_rep Optional
Positional or keyword
Default None
str

Choose the text used to display missing values.

precision Optional
Positional or keyword
Default None
int

Choose the requested number of decimal places or displayed digits.

decimal Optional
Positional or keyword
Default '.'
str

Identify the character used as the decimal mark.

thousands Optional
Positional or keyword
Default None
str

Identify the character separating groups of digits.

escape Optional
Positional or keyword
Default None
str

Control escaping of reserved output characters.

hyperlinks Optional
Positional or keyword
Default None
{"html", "latex"}

Returns

Styler