Highlight missing values with a style.
Background color to use for highlighting.
Added in version 1.5.0.
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 data to before applying the function.
CSS properties to use for highlighting. If props is given, color is not used.
Added in version 1.3.0.
See also
Styler.highlight_maxHighlight the maximum with a style.
Styler.highlight_minHighlight the minimum with a style.
Styler.highlight_betweenHighlight a defined range with a style.
Styler.highlight_quantileHighlight values defined by a quantile with a style.
Examples
>>> df = pd.DataFrame({'A': [1, 2], 'B': [3, np.nan]})
>>> df.style.highlight_null(color='yellow')
Please see: Table Visualization for more examples.
© 2008–2011, AQR Capital Management, LLC, Lambda Foundry, Inc. and PyData Development Team
© 2011–2025, Open source contributors
Licensed under the 3-clause BSD License.
https://pandas.pydata.org/pandas-docs/version/2.3.0/reference/api/pandas.io.formats.style.Styler.highlight_null.html