Skip to content

BUG: Subset slicer on Styler failed on MultiIndex with slice(None) #39421

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

Merged
merged 11 commits into from
Feb 4, 2021

Conversation

attack68
Copy link
Contributor

@attack68 attack68 commented Jan 26, 2021

The problem with above issue was with the function non_reducing_slice. It didn't correctly re-format slicing tuples on multiindices when rows or cols also contained a slice(None). An additional check is now done. This method is only used for Styler currently.

Tests Added / reformmatted.

@attack68
Copy link
Contributor Author

attack68 commented Feb 1, 2021

ready for review..

# Conflicts:
#	doc/source/whatsnew/v1.3.0.rst
@jreback jreback added Bug MultiIndex Styler conditional formatting using DataFrame.style labels Feb 3, 2021
@jreback jreback added this to the 1.3 milestone Feb 3, 2021
@jreback
Copy link
Contributor

jreback commented Feb 3, 2021

can you merge master

@jreback
Copy link
Contributor

jreback commented Feb 3, 2021

cc @phofl @jbrockmendel if you'd have a look

part, tuple
)
if isinstance(part, tuple):
# check for sub-slice:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you add "GH#39421" here

instead of a for loop can you do this with an any(...)

@phofl
Copy link
Member

phofl commented Feb 3, 2021

lgtm

@jreback jreback merged commit caf482d into pandas-dev:master Feb 4, 2021
@jreback
Copy link
Contributor

jreback commented Feb 4, 2021

thanks @attack68

@attack68 attack68 deleted the subset_slicer branch February 4, 2021 06:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug MultiIndex Styler conditional formatting using DataFrame.style
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: df.style.apply(subset=...) argument only works for explicit slices but not ":"
4 participants