print_table¶
- emlib.misc.print_table(rows, headers=(), tablefmt='', showindex=True, floatfmt='g')[source]¶
Print rows as table
- Parameters:
rows (
list) – a list of namedtuples or dataclass objects, all of the same kindheaders – override the headers defined in rows
tablefmt – if None, a suitable default for the current situation will be used (depending on if we are running inside jupyter or in a terminal, etc) Otherwise it is passed to tabulate.tabulate
floatfmt (
str|tuple[str,...]) – a format for all floats or a tuple of formatsshowindex – if True, add a column with the index of each row
- Return type:
None