Skip to content

HiroshiARAKI/pytable

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pyTable

version Python matplotlib

pyTable is the library to plot table easily!
(on matplotlib)

installation

$ pip install pytab

How to use?

Example / table_0.py

You can plot a table easily by giving data as a dict object as below.

import pytab as pt


if __name__ == '__main__':
    data = {
        'a': [1.0, 2.1, 3.5, '-', 2.0, 1.0, 2.1, 3.5, 4.0, 2.0, ],
        'b': [5.7, 6.1, 7.2, 8.3, 1.2, 5.7, 6.1, 7.2, 8.3, '-', ],
        }

    # The simplest table
    pt.table(data=data)

    pt.show()

table0

Example / table_1.py

And, you can design a table easily.

import pytab as pt


if __name__ == '__main__':
    data = {
        'a': [1.0, 2.1, 3.5, 4.0, 2.0, 1.0, 2.1, 3.5, 4.0, 2.0, ],
        'b': [5.7, 6.1, 7.2, 8.3, 1.2, 5.7, 6.1, 7.2, 8.3, 1.2, ],
        }

    rows = [str(i) for i in range(len(data['a']))]

    pt.table(data=data,
             rows=rows,  # set numbers as row
             th_c='#aaaaee',  # set table header background-color
             td_c='gray',     # set table data (rows) background-color
             table_type='striped',  # set table type as 'striped'
             )

    pt.show()

table1

Documentation

[en] pyTable Documentation
[jp] pyTable ドキュメント

LICENSE

MIT
Copyright (c) 2020 HiroshiARAKI All Rights Reserved.

About

pytable is the library to plot table easily.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages