예제 #1
0
def test_table():
    import math
    from pytools import Table

    tbl = Table()
    tbl.add_row(("i", "i^2", "i^3", "sqrt(i)"))

    for i in range(8):
        tbl.add_row((i, i**2, i**3, math.sqrt(i)))

    print(tbl)
    print()
    print(tbl.latex())
예제 #2
0
def test_table():
    import math
    from pytools import Table

    tbl = Table()
    tbl.add_row(("i", "i^2", "i^3", "sqrt(i)"))

    for i in range(8):
        tbl.add_row((i, i**2, i**3, math.sqrt(i)))

    print(tbl)
    print()
    print(tbl.latex())

    # {{{ test merging

    from pytools import merge_tables
    tbl = merge_tables(tbl, tbl, tbl, skip_columns=(0, ))
    print(tbl.github_markdown())