pandas.io.formats.style.Styler.map

pandas 3.1.1 · Styling · method

Generate a CSS declaration for each data cell by calling the style function on its value.

Call syntax

Styler.map(func, subset=None, **kwargs)

Run the example

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

Parameters

ParameterRequirementAccepted values and behavior
func Required
Positional or keyword
function

Supply a supported operation name or a callable, depending on this API.

subset Optional
Positional or keyword
Default None
label, array-like, IndexSlice

Restrict the operation to these labels instead of considering the whole object.

**kwargs Optional
Additional keyword arguments

Returns

Styler