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 / View on Github external
def to_string(
    data, header=None, alignment="l", padding=(0, 1), style=styles.thin_double
        depth = len(data.shape)
    except AttributeError:
        depth = _get_depth(data)

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

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

    # Make sure the data is consistent
    num_columns = len(data[0][0])
github nschloe / perfplot / perfplot / 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")


Pretty tables in the terminal

Latest version published 3 years ago

Package Health Score

51 / 100
Full package analysis

Popular termtables functions