Skip to content

BUG: Styler.hide_columns fails when not sparsifying #43464

@attack68

Description

@attack68

  • 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

pd.options.styler.sparse.columns=False

midx = MultiIndex.from_product([[1, 2],["a", "a", "b"]], names=["zero", "one"])
df = DataFrame(9, index=midx, columns=midx)
styler = df.style.hide_columns((1, "a"))
styler

Issue Description

Screen Shot 2021-09-08 at 20 40 49

Expected Behavior

Columns are hidden in the header row

Installed Versions

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugIO HTMLread_html, to_html, Styler.apply, Styler.applymapStylerconditional formatting using DataFrame.style

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions