compare_to_threshold_styler#

mobgap.utils.tables.compare_to_threshold_styler(
thresholds: dict[Hashable, float],
higher_is_pass: dict[Hashable, float],
pass_style: str = 'background-color: lightgreen',
fail_style: str = 'background-color: lightcoral',
) Callable[[DataFrame], DataFrame][source]#

Style the elements in a DataFrame that are above or below a threshold.

Parameters:
thresholds

A dictionary with the column names as keys and the threshold values as values.

higher_is_pass

A dictionary with the column names as keys and the threshold values as values.

pass_style

The CSS style to apply to the elements that pass the threshold.

fail_style

The CSS style to apply to the elements that fail the threshold.