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

ENH: Styler.highlight_quantile method #40926

Merged
merged 16 commits into from
Apr 20, 2021

Conversation

attack68
Copy link
Contributor

@attack68 attack68 commented Apr 13, 2021

Screen Shot 2021-04-14 at 08 43 54

@attack68 attack68 added this to the 1.3 milestone Apr 13, 2021
@attack68 attack68 marked this pull request as ready for review April 14, 2021 08:57
@attack68 attack68 changed the title [WIP] ENH: Styler.highlight_quantile method ENH: Styler.highlight_quantile method Apr 14, 2021
@attack68 attack68 added Styler conditional formatting using DataFrame.style Enhancement labels Apr 14, 2021
axis, axis_apply = 1, 0
else:
axis, axis_apply = None, None
q = np.nanquantile(
Copy link
Contributor

Choose a reason for hiding this comment

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

is there a reason you are not using Series.quantile? (which does handle timetamp and other types).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

previously I was using qcut which was criticised, probably for good reason, so I switched to NumPy, to be honest didn't see these when searching.

However, numpy allows axis=None, whereas to achieve the same result here I will need to ravel a DataFrame to a Series and apply the calculation. Still, I will give it a try.

@jreback jreback merged commit eaaefd1 into pandas-dev:master Apr 20, 2021
@jreback
Copy link
Contributor

jreback commented Apr 20, 2021

thanks @attack68

@attack68 attack68 deleted the highlight_quantile branch April 21, 2021 06:08
yeshsurya pushed a commit to yeshsurya/pandas that referenced this pull request Apr 21, 2021
yeshsurya pushed a commit to yeshsurya/pandas that referenced this pull request May 6, 2021
JulianWgs pushed a commit to JulianWgs/pandas that referenced this pull request Jul 3, 2021
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.

2 participants