python-tabulate
python-tabulate copied to clipboard
Pretty-print tabular data in Python, a library and a command-line utility. Repository migrated from bitbucket.org/astanin/python-tabulate.
I realize that Markdown is a mess, but for ``tablefmt="github"`` with ``stralign`` argument, the header line (which goes as ``-----------``) can be modified as the following: * ``stralign="left"``: header lines...
pandas DataFrame columns.name (top-left cell when indexes are displayed) is missing ```python from tabulate import tabulate from pandas import DataFrame df = DataFrame([[1,2],[3,4]],columns=['a','b']) df.columns.name = 'some_name' print(df) # let's see...
Another output type that would have the same output as mysql \G modifier to make some information easier to read for tabulate. ``` mysql> SHOW MASTER STATUS; +------------------+----------+--------------+------------------+ | File...
According to the [Asciidoc table documentation](https://docs.asciidoctor.org/asciidoc/latest/tables/align-by-column/) the align operator must be put in front of the column width. `python-tabulate` is putting it behind the column width. The following table appears...
This is an excellent python utility. I'd use it a lot more if I could have sub headings. Here's an example: I have this table: ``` | site | name...
Apparently integer `DataFrame` columns are implicitly converted to floats, which makes proper integer formatting impossible, and worse, passing e.g. `floatfmt=".6f" will lead to non-sense formatting of integer columns. Here is...
To reproduce: ```py import tabulate import numpy as np print(tabulate.tabulate([[ np.datetime64('2022-10-05', 'ns') ]])) ``` Out: ``` ----------- 1.66493e+18 ----------- ```
I am trying to format a table with floating point numbers with a fixed number of trailing decimals including zeros (including redundant zeros) so I want something like ``` #NUM...
Best shown with an example: ``` >>> x = tabulate.tabulate([[34454634.345], [3.0]], headers=['doesnt work'], floatfmt='17,.4f', tablefmt='simple') >>> print(x) doesnt work ---------------------- 34,454,634.3450 3.0000 ``` The numbers in the first column aren't...
This contribution corrects the behavior of the `headers` option when the input data is a list of dict. 1. Fix the behavior of `headers="firstrow"`. The example below illustrates the current...