Skip to content

ENH: add set_td_classes method for CSS class addition to data cells #36159

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
Sep 13, 2020

Conversation

attack68
Copy link
Contributor

@attack68 attack68 commented Sep 6, 2020

  • tests added / passed
  • passes black pandas
  • passes git diff upstream/master -u -- "*.py" | flake8 --diff
  • whatsnew entry

Simple extension to Styler to allow cells to be assigned CSS classes from a DataFrame of strings.
Seems to be a reasonably common request.
The existing framework, i.e. the cell_context dictionary (which previously did nothing) is leveraged.

@TomAugspurger

@attack68 attack68 changed the title ENH: add set_data_classes method for CSS class addition to datat cells ENH: add set_data_classes method for CSS class addition to data cells Sep 6, 2020
@jreback jreback added the Styler conditional formatting using DataFrame.style label Sep 8, 2020
@attack68 attack68 changed the title ENH: add set_data_classes method for CSS class addition to data cells ENH: add set_td_classes method for CSS class addition to data cells Sep 8, 2020
Copy link
Contributor

@TomAugspurger TomAugspurger left a comment

Choose a reason for hiding this comment

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

Looks good. Can you add a test for the reindexing case though?

@attack68
Copy link
Contributor Author

attack68 commented Sep 9, 2020

reindexing tests like these added?

@attack68 attack68 mentioned this pull request Sep 9, 2020
5 tasks
@jreback jreback added this to the 1.2 milestone Sep 13, 2020
@jreback jreback merged commit 70d0dd0 into pandas-dev:master Sep 13, 2020
@jreback
Copy link
Contributor

jreback commented Sep 13, 2020

thanks @attack68
can you do a followon which updates the notebook to use this feature (or is this pretty esoteric)?

@attack68
Copy link
Contributor Author

@jreback I have a few Styler PRs being worked, plan is to update the docs notebook after they all get finalised, preferably well before 1.2 release? I can link them with each other, since there will be multiple ways now of achieving same results.

@attack68 attack68 deleted the enh_styler_class branch September 13, 2020 14:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement Styler conditional formatting using DataFrame.style
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants