Skip to content

ENH: allow concat of Styler objects #46105

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 48 commits into from
Feb 27, 2022
Merged

Conversation

attack68
Copy link
Contributor

@attack68 attack68 commented Feb 21, 2022

@mroeschke
Copy link
Member

Not sure if this assessment is correct, but this would this be a generic version of pd.pivot_table + styling?
https://pandas.pydata.org/docs/reference/api/pandas.pivot_table.html

Copy link
Contributor

@jreback jreback left a comment

Choose a reason for hiding this comment

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

only a very brief look but the same problem as the other PR
this is commingling calculation and display

@attack68
Copy link
Contributor Author

only a very brief look but the same problem as the other PR this is commingling calculation and display

yes, ok i now see your point. how about I change tack and require a user to pass an already calculated dataframe or Styler object which will be appended to the footer? This would also get around any need to format or style the footer since it would inherit from the passed Styler object?

@attack68 attack68 marked this pull request as draft February 22, 2022 18:05
@attack68 attack68 changed the title EHN: add footer to Styler output with custom descriptors on data WIP: allow concat of Styler objects Feb 22, 2022
@attack68
Copy link
Contributor Author

@jreback I completely reworked this and managed to get the entire implementation under 20 lines execution code. All calculations are done by the user, they just pass a second styler object.

@attack68 attack68 marked this pull request as ready for review February 23, 2022 20:18
@attack68 attack68 changed the title WIP: allow concat of Styler objects ENH: allow concat of Styler objects Feb 23, 2022
@attack68 attack68 added Enhancement Styler conditional formatting using DataFrame.style labels Feb 25, 2022
@attack68 attack68 added this to the 1.5 milestone Feb 25, 2022
Copy link
Member

@mroeschke mroeschke left a comment

Choose a reason for hiding this comment

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

Overall I'm +1 for this API compared to the previous one

Copy link
Contributor

@jreback jreback left a comment

Choose a reason for hiding this comment

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

+1 on this too, much better api a few comments

@jreback jreback merged commit 354c0bd into pandas-dev:main Feb 27, 2022
@attack68 attack68 deleted the styler_footer branch February 28, 2022 15:06
yehoshuadimarsky pushed a commit to yehoshuadimarsky/pandas that referenced this pull request Jul 13, 2022
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.

ENH: Add option to display dtypes below column headers
3 participants