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
funcshould take a scalar and return a scalar.- subsetIndexSlice
A valid indexer to limit
datato before applying the function. Consider using a pandas.IndexSlice.- **kwargsdict
Pass along to
func.
- Returns
- selfStyler
See also
Styler.whereUpdates the HTML representation with a style which is selected in accordance with the return value of a function.