Styler.
background_gradient
Color the background in a gradient style.
The background color is determined according to the data in each column (optionally row). Requires matplotlib.
Matplotlib colormap.
Compress the range by the low.
Compress the range by the high.
Apply to each column (axis=0 or 'index'), to each row (axis=1 or 'columns'), or to the entire DataFrame at once with axis=None.
axis=0
'index'
axis=1
'columns'
axis=None
A valid slice for data to limit the style application to.
data
Luminance threshold for determining text color. Facilitates text visibility across varying background colors. From 0 to 1. 0 = all text is dark colored, 1 = all text is light colored.
New in version 0.24.0.
Minimum data value that corresponds to colormap minimum value. When None (default): the minimum value of the data will be used.
New in version 1.0.0.
Maximum data value that corresponds to colormap maximum value. When None (default): the maximum value of the data will be used.
If text_color_threshold is not a value from 0 to 1.
text_color_threshold
Notes
Set text_color_threshold or tune low and high to keep the text legible by not using the entire range of the color map. The range of the data is extended by low * (x.max() - x.min()) and high * (x.max() - x.min()) before normalizing.
low
high
low * (x.max() - x.min())
high * (x.max() - x.min())