Skip to content

BUG: latex styling index and hide levels #45156

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 Jan 1, 2022 · 0 comments · Fixed by #45157
Closed
3 tasks done

BUG: latex styling index and hide levels #45156

attack68 opened this issue Jan 1, 2022 · 0 comments · Fixed by #45157
Labels
Bug IO LaTeX to_latex Styler conditional formatting using DataFrame.style

Comments

@attack68
Copy link
Contributor

attack68 commented Jan 1, 2022

Pandas version checks

  • 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 = pd.DataFrame([[1]], 
                  index=pd.MultiIndex.from_tuples([(0,1)], names=["l0", "l1"]), 
                  columns=pd.MultiIndex.from_tuples([(0,1)], names=["c0", "c1"]))
df.style.hide(level=1).applymap_index(lambda v: "color: red;", level=0, axis=1)

Issue Description

The above renders fine with HTML but when converting to LaTeX formatting functions are offset and lost.

Expected Behavior

works

Installed Versions

Replace this line with the output of pd.show_versions()

@attack68 attack68 added Bug Needs Triage Issue that has not been reviewed by a pandas team member IO LaTeX to_latex Styler conditional formatting using DataFrame.style and removed Needs Triage Issue that has not been reviewed by a pandas team member labels Jan 1, 2022
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.

1 participant