Thanks to visit codestin.com
Credit goes to github.com

Skip to content

BUG: Styler IndexError when rendering an empty DataFrame #43305

Closed
@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.

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


df = pd.DataFrame()
midx = pd.MultiIndex.from_arrays([["A", "B"], [1, 2]], names=["zero", "one"])
df.style  # OK
df.index=[0,1]
df.style  # OK
df.index=midx
df.style  # IndexError

The error here was not the use of MultiIndex but of the index name display row when there are no columns.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugStylerconditional formatting using DataFrame.style

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions