Skip to content
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

BUG: Styler IndexError when rendering an empty DataFrame #43305

Closed
2 of 3 tasks
attack68 opened this issue Aug 30, 2021 · 0 comments · Fixed by #43327
Closed
2 of 3 tasks

BUG: Styler IndexError when rendering an empty DataFrame #43305

attack68 opened this issue Aug 30, 2021 · 0 comments · Fixed by #43327
Labels
Bug Styler conditional formatting using DataFrame.style
Milestone

Comments

@attack68
Copy link
Contributor

attack68 commented Aug 30, 2021

  • 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.

@attack68 attack68 added Bug Needs Triage Issue that has not been reviewed by a pandas team member Styler conditional formatting using DataFrame.style and removed Needs Triage Issue that has not been reviewed by a pandas team member labels Aug 30, 2021
@jreback jreback added this to the 1.4 milestone Aug 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Styler conditional formatting using DataFrame.style
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants