Skip to main content

pTable is the library to plot table easily!

Project description

Python matplotlib

pTable 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

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

table1

LICENSE

MIT
Copyright (c) 2020 HiroshiARAKI All Rights Reserved.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pytab-1.0.0b1.tar.gz (4.1 kB view details)

Uploaded Source

File details

Details for the file pytab-1.0.0b1.tar.gz.

File metadata

  • Download URL: pytab-1.0.0b1.tar.gz
  • Upload date:
  • Size: 4.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Python-urllib/3.7

File hashes

Hashes for pytab-1.0.0b1.tar.gz
Algorithm Hash digest
SHA256 7a7a0c78f7d09a495bd20f113392baa70c9b849af9d40c7a6ce22b23cb096ae7
MD5 f96ce58d6d736e16cad053ab6fc9d199
BLAKE2b-256 25f886cdc5c0b9b18dc5e7175783f8bd1a8bd024f175dacc5ae6e83d9c7aef4b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page