print_table¶
- emlib.misc.print_table(rows, headers=(), tablefmt='', showindex=True, floatfmt='')[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 (
str
) – 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.tabulatefloatfmt (
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