pandas.io.formats.style.Styler.where¶
-
Styler.where(cond, value, other=None, subset=None, **kwargs)[source]¶ Apply a function elementwise, updating the HTML representation with a style which is selected in accordance with the return value of a function.
New in version 0.21.0.
Parameters: cond : callable
condshould take a scalar and return a booleanvalue : str
applied when
condreturns trueother : str
applied when
condreturns falsesubset : IndexSlice
a valid indexer to limit
datato before applying the function. Consider using a pandas.IndexSlicekwargs : dict
pass along to
condReturns: self : Styler
See also