Skip to content

BUG: latex css conversion does not work on new applymap_index #43648

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
3 tasks done
attack68 opened this issue Sep 18, 2021 · 0 comments · Fixed by #43657
Closed
3 tasks done

BUG: latex css conversion does not work on new applymap_index #43648

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

Comments

@attack68
Copy link
Contributor

  • I have checked that this issue has not already been reported.

  • I have confirmed this bug exists on the latest version of pandas.

  • I have confirmed this bug exists on the master branch of pandas.

Reproducible Example

df = DataFrame([[0], [1]], index=[0, 1])
styler = df.style
styler.applymap(lambda x: "color: red;" if x == 0 else "")
styler.applymap_index(lambda x: "color: blue;" if x == 0 else "")
print(styler.to_latex(convert_css=True))

\begin{tabular}{lr}
 & 0 \\
\colorblue 0 & \color{red} 0 \\
1 & 1 \\
\end{tabular}

Issue Description

the new method applymap_index has not been hooked up to the CSS conversion for styler.to_latex.

Expected Behavior

should convert to color{blue}

Installed Versions

master

@attack68 attack68 added Bug Needs Triage Issue that has not been reviewed by a pandas team member labels Sep 18, 2021
@attack68 attack68 added Styler conditional formatting using DataFrame.style IO LaTeX to_latex and removed Needs Triage Issue that has not been reviewed by a pandas team member labels Sep 19, 2021
@jreback jreback added this to the 1.4 milestone Sep 21, 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