Open
Description
In the latest pandas version 1.4.2 there exists an option to enable bold rows but there isn't a similar option to do the same for the columns. It is something some users on SO were asking for and it seems very logical.
The example from the official documentation with bold_rows=True
and bold_column_headers=True
should lead to the following example.
import pandas as pd
df = pd.DataFrame(
dict(name=['Raphael', 'Donatello'],
mask=['red', 'purple'],
weapon=['sai', 'bo staff']
)
)
result= df.to_latex(bold_rows=True, bold_column_headers=True)
>>> result
\begin{tabular}{llll}
\toprule
{} & \textbf{name} & \textbf{mask} & \textbf{weapon} \\
\midrule
\textbf{0} & Raphael & red & sai \\
\textbf{1} & Donatello & purple & bo staff \\
\bottomrule
\end{tabular}