How to use termtables - 2 common examples

To help you get started, we’ve selected a few termtables examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github nschloe / termtables / termtables / main.py View on Github external
def to_string(
    data, header=None, alignment="l", padding=(0, 1), style=styles.thin_double
):
    try:
        depth = len(data.shape)
    except AttributeError:
        depth = _get_depth(data)

    if depth == 2:
        data = [data]
    else:
        assert depth == 3

    if header:
        data = [[header]] + data

    # Make sure the data is consistent
    num_columns = len(data[0][0])
github nschloe / perfplot / perfplot / main.py View on Github external
def __repr__(self):
        data = numpy.column_stack([self.n_range, self.timings.T])
        return tt.to_string(data, header=["n"] + self.labels, style=None, alignment="r")

termtables

Pretty tables in the terminal

GPL-3.0
Latest version published 3 years ago

Package Health Score

51 / 100
Full package analysis

Popular termtables functions