-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
REGR: styler.highlight_min/max
did not ignore pd.NA
and caused error
#42861
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
Conversation
attack68
commented
Aug 3, 2021
- closes BUG: highlight_min and highlight_max do not work with pd.NA #42750
- tests added / passed
- whatsnew entry
pandas/io/formats/style.py
Outdated
@@ -2348,7 +2348,11 @@ def highlight_max( | |||
""" | |||
|
|||
def f(data: FrameOrSeries, props: str) -> np.ndarray: | |||
return np.where(data == np.nanmax(data.to_numpy()), props, "") | |||
arg = {"skipna": True} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think actually just passing the arg is better here e.g. max(skipna=True)
as more readable
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i refactored this, pulling the function out, have a relook
thanks @attack68 |
@meeseeksdev backport 1.3.x |
Owee, I'm MrMeeseeks, Look at me. There seem to be a conflict, please backport manually. Here are approximate instructions:
And apply the correct labels and milestones. Congratulation you did some good work ! Hopefully your backport PR will be tested by the continuous integration and merged soon! If these instruction are inaccurate, feel free to suggest an improvement. |
Owee, I'm MrMeeseeks, Look at me. There seem to be a conflict, please backport manually. Here are approximate instructions:
And apply the correct labels and milestones. Congratulation you did some good work ! Hopefully your backport PR will be tested by the continuous integration and merged soon! If these instruction are inaccurate, feel free to suggest an improvement. |
…ror (pandas-dev#42861) (cherry picked from commit b9edc9a)
linking #42879 |