smpl_doc.doc.array_table
- smpl_doc.doc.array_table(arr, top=True, bottom=True, init=True, tabs=1, header=True)[source]
Produces a reST table from a numpy array or normal 2d array.
Parameters
- arr
numpy.ndarray
,list
ordict
2d array or dict
- top
bool
If
True
a top line is added.- bottom
bool
If
True
a bottom line is added.- init
bool
If
True
a tab is added at the beginning of each line.- tabs
int
Number of tabs at the beginning of each line.
- header
bool
If
True
the first row is used as header.
Examples
>>> print(trim_eol_spaces(array_table([["a","b"],["hihi", "hoho"]],tabs=0))) ====== ====== a b ====== ====== hihi hoho ====== ====== >>> print(trim_eol_spaces(array_table({"a":["hihi",2],"b": ["hoho",3]},tabs=0,header=False))) === ====== === a hihi 2 b hoho 3 === ====== ===
- arr