pandas.io.formats.style.Styler.applymap

Styler.applymap(func, subset=None, **kwargs)[source]

Apply a function elementwise.

Updates the HTML representation with the result.

Parameters
funcfunction

func should take a scalar and return a scalar.

subsetIndexSlice

A valid indexer to limit data to before applying the function. Consider using a pandas.IndexSlice.

**kwargsdict

Pass along to func.

Returns
selfStyler

See also

Styler.where

Updates the HTML representation with a style which is selected in accordance with the return value of a function.