sábado, 13 de octubre de 2018

Imprimir tablas en python formateadas para analisis numerico

Imprimir tablas en python formateadas

https://github.com/nirum/tableprint

https://geekaldescubierto.com/index.php/2018/04/07/como-hacer-tablas-en-python-con-tabulate/


tableprint lets you easily print formatted tables of data. Unlike other modules, you can print single rows of data at a time (useful for printing ongoing computation results).
Example output


import tableprint as tp
import numpy as np

data = np.random.randn(10, 3)
headers = ['Column A', 'Column B', 'Column C']

tp.table(data, headers)
The header and row functions allow you to print just the header or just a row of data, respectively, which is useful for continuously updating a table during a long-running computation. Also, the banner function is useful for just printing out a nicely formatted message to the user.
The TableContext context manager is useful for dynamically updating tables (e.g. during a long running computation):
import tableprint as tp
import numpy as np
import time

with tp.TableContext("ABC") as t:
    for _ in range(10):
        time.sleep(0.1)
        t(np.random.randn(3,))

No hay comentarios:

Publicar un comentario