best_in_group_styler#

mobgap.utils.tables.best_in_group_styler(
groupby: Hashable | list[Hashable],
columns: dict[Hashable, bool],
style: str = 'font-weight: bold',
) Callable[[DataFrame], DataFrame][source]#

Style the best element in a column, after grouping by the index or another column.

Parameters:
groupby

A valid groupby argument for groupby.

columns

A dictionary with the column names as keys and a boolean value if the best element is the largest or smallest. True for “larger is better”, False for “smaller is better”.

style

The CSS style to apply to the best element.