Examples

In [1]:
import numpy as np
import pandas as pd
In [2]:
df = pd.DataFrame({'name': ['Leonardo', 'Michelangelo'],
                   'mask': ['blue', 'orange'],
                   'weapon': ['katana', 'nunchaku']})
df.to_latex(index=False) 
Out[2]:
'\\begin{tabular}{lll}\n\\toprule\n         name &    mask &    weapon \\\\\n\\midrule\n     Leonardo &    blue &    katana \\\\\n Michelangelo &  orange &  nunchaku \\\\\n\\bottomrule\n\\end{tabular}\n'