pandas.io.formats.style.Styler.highlight_null
- Styler.highlight_null(color='red', subset=None, props=None)
Highlight missing values with a style.
- Parameters:
- color : str, default ‘red’
Background color to use for highlighting.
- subset : label, array-like, IndexSlice, optional
A valid 2d input to DataFrame.loc[<subset>], or, in the case of a 1d input or single key, to DataFrame.loc[:, <subset>] where the columns are prioritised, to limit
datato before applying the function.- props : str, default None
CSS properties to use for highlighting. If
propsis given,coloris not used.
- Returns:
- Styler
Examples
>>> df = pd.DataFrame({'A': [1, 2], 'B': [3, np.nan]}) >>> df.style.highlight_null(color='yellow')Please see: Table Visualization for more examples.