mlresearch.latex.make_bold

mlresearch.latex.make_bold(table, maximum=True, threshold=None, decimals=2, axis=1)[source]

Make bold the lowest or highest values, or values lower than, or higher than the passed value in threshold per row or column.

Parameters:
tablepd.DataFrame

Dataframe with results statistics. Must not contain non-indexed metadata. Supports both single and multi index.

maximumbool, default=True

Whether to look for the highest or lowest values:

  • If True and threshold is None, boldfaces the highest value in each row/column.

  • If False and threshold is None, boldfaces the lowest value in each row/column.

  • If True and threshold is not None, boldfaces all values above the given threshold.

  • If False and threshold is not None, boldfaces all values below the given threshold.

thresholdint or float, default=None

Threshold to boldface values. If None, one value will be boldfaced per row or column. If not None, boldfaces all values above or below threshold.

decimalsint, default=2

Number of decimal places to round each value to.

axis{0 or ‘index’, 1 or ‘columns’}, default=1

Axis along which the function is applied:

  • 0 or ‘index’: apply function to column.

  • 1 or ‘columns’: apply function to each row.