milia.plot.tables#

Great Tables in twiga’s table theme, with plain column labels.

Functions

record(stats, title[, subtitle, decimals])

Two-column statistic | value table of a one-row summary.

table(gt[, rows, width])

Twiga's table theme with dark-on-white column labels; apply it last.

text(value, decimals)

A value formatted for a table cell.

milia.plot.tables.table(gt, rows=None, width='100%')#

Twiga’s table theme with dark-on-white column labels; apply it last.

Parameters:
  • gt (GT | DataFrame) – A great-tables GT or a DataFrame.

  • rows (int | None) – Body rows, for the row stripes; counted when omitted.

  • width (str) – CSS width of the table.

Return type:

GT

Returns:

The styled GT.

Examples

>>> import pandas as pd
>>> type(table(pd.DataFrame({"a": [1, 2]}))).__name__
'GT'
milia.plot.tables.text(value, decimals)#

A value formatted for a table cell.

Parameters:
  • value (object) – The value.

  • decimals (int) – Decimal places of non-integer numbers.

Return type:

str

Returns:

The text; integers get thousands separators.

Examples

>>> text(1234, 2), text(0.12345, 3), text(True, 2)
('1,234', '0.123', 'True')
milia.plot.tables.record(stats, title, subtitle=None, decimals=3)#

Two-column statistic | value table of a one-row summary.

Parameters:
Return type:

GT

Returns:

The styled GT.

Examples

>>> type(record({"auc": 0.91, "fpr": 0.08}, "Detector")).__name__
'GT'