-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
ENH: gb.is_monotonic_increasing #17015
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
Comments
@No-Stream : I'm not sure I follow your output here. Can you explain why you get |
@gfyoung I should have explained a bit more but glossed over the details since the suggested enhancement is basically just syntactic sugar. Gb.apply(lambda x: x.seriesproperty) looks ugly to me. I'd rather have gb.gbmethod() In the example, category a (cat_a) is monotonically increasing (so not monotonically decreasing) and category b is in fact categorically decreasing. So you get False, True. This behavior is correct. |
your |
…ev#18269) ENH: gb.is_monotonic_increasing pandas-dev#17015 fix rebase conflicts parametrized tests for gb.is_monotonic_increasing/decreasing ENH: gb.is_monotonic_increasing, is_monotonic_decreasing pandas-dev#17015 added tests for gb.is_monotonically_increasing()/decreasing parametrized tests for gb.is_monotonic_increasing/decreasing ENH: gb.is_monotonic_increasing pandas-dev#17015 fix rebase conflicts ENH: gb.is_monotonic_increasing pandas-dev#17015 fix rebase conflicts rebase and cleanup simplified test format fixed whatsnew to include method tags
…remove function defs
Code Sample, a copy-pastable example if possible
Problem description
In order to check which groups are monotonically increasing or decreasing, you can currently use gb.apply(lambda x: x.is_monotonic_increasing).
What I'm suggesting is that Series.is_monotonic_increasing be extended to groupby, so there would be a groupby.is_monotonic_increasing() method, which would return the same output as the apply.
I'm not sure if extending a Series property to a Groupby method is something that makes sense for Pandas, and I haven't contributed to Pandas before, but I wanted to ask.
Expected Output
Output of
pd.show_versions()
The text was updated successfully, but these errors were encountered: