Skip to content

BUG: Styler.to_latex permanently impacts table_styles for successive calls #42320

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
attack68 opened this issue Jun 30, 2021 · 0 comments · Fixed by #42323
Closed

BUG: Styler.to_latex permanently impacts table_styles for successive calls #42320

attack68 opened this issue Jun 30, 2021 · 0 comments · Fixed by #42323
Labels
Bug IO LaTeX to_latex Styler conditional formatting using DataFrame.style
Milestone

Comments

@attack68
Copy link
Contributor

For

styler = DataFrame([[1]]).style

doing

styler.to_latex(hrules=True) (or any other kw argument which impacts table_styles)

results in:

\begin{tabular}{lr}
\toprule
{} & {0} \\
\midrule
0 & 1 \\
\bottomrule
\end{tabular}

Now doing

styler.to_latex(hrules=False)

still results in

\begin{tabular}{lr}
\toprule
{} & {0} \\
\midrule
0 & 1 \\
\bottomrule
\end{tabular}

because the table_styles attribute on styler has been overwritten by first call which dominates the second.

@attack68 attack68 added Bug IO LaTeX to_latex Styler conditional formatting using DataFrame.style labels Jun 30, 2021
@jreback jreback added this to the 1.3 milestone Jun 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug IO LaTeX to_latex Styler conditional formatting using DataFrame.style
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants