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,listordict 2d array or dict
- top
bool If
Truea top line is added.- bottom
bool If
Truea bottom line is added.- init
bool If
Truea tab is added at the beginning of each line.- tabs
int Number of tabs at the beginning of each line.
- header
bool If
Truethe 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