Skip to content

BUG: latex styling index and hide levels #45156

Closed
@attack68

Description

@attack68

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()

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugIO LaTeXto_latexStylerconditional formatting using DataFrame.style

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions