-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
DOC Fixing EX01 - added examples #53181
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
pandas/core/groupby/generic.py
Outdated
def is_monotonic_increasing(self) -> Series: | ||
# GH13 |
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.
Yeah we don't need this (and below)
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.
Thanks, I'll remove them.
I can't tell (for sure) if failing tests are related to my changes |
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.
Nice work!
I think the changes are unrelated - I've just made a minor request, if you make that and then also fetch and merge upstream/main then I'd like to think that CI will be fixed
>>> s = pd.Series([3, 2, 2, 1]) | ||
>>> s.is_monotonic_decreasing |
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.
for this and the above, could we add an example for when the return value is False
?
In general, for functions which return -> bool
, it's probably good to have a simple example of both cases (something quick and simple is fine)
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.
Done, thanks for the instructions.
>>> s.is_unique | ||
False |
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.
this one also returns bool
;) rest looks good though!
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 should have seen it :) .. thanks
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.
new examples look good, thanks! I just missed one last (I promise!) comment last time
pandas/core/groupby/generic.py
Outdated
def is_monotonic_decreasing(self) -> Series: | ||
""" | ||
Return boolean if values in the group are monotonically decreasing. |
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.
so sorry, I missed this the first time round
it doesn't return a boolean, but a Series of booleans
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.
My fault 🫣
pandas/core/groupby/generic.py
Outdated
Returns | ||
------- | ||
bool |
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.
Series
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.
Changed
pandas/core/groupby/generic.py
Outdated
Return boolean if values in the group are monotonically increasing. | ||
|
||
Returns | ||
------- | ||
bool |
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.
same comment
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.
Done
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.
cool, let's get this in - thanks @DeaMariaLeon !
Thanks @MarcoGorelli! - love the cat |
* DOC Fixing EX01 - added examples * Removed Index.item from code_checks * Removed #GH13 * Added case for return value=False * Added False case for is_unique * Correct docstring * really minor clarification (there may be multiple groups, so "the group" isnt defined) --------- Co-authored-by: MarcoGorelli <[email protected]>
* DOC Fixing EX01 - added examples * Removed Index.item from code_checks * Removed #GH13 * Added case for return value=False * Added False case for is_unique * Correct docstring * really minor clarification (there may be multiple groups, so "the group" isnt defined) --------- Co-authored-by: MarcoGorelli <[email protected]>
* DOC Fixing EX01 - added examples * Removed Index.item from code_checks * Removed #GH13 * Added case for return value=False * Added False case for is_unique * Correct docstring * really minor clarification (there may be multiple groups, so "the group" isnt defined) --------- Co-authored-by: MarcoGorelli <[email protected]>
Towards #37875
I couldn't locally build the html files for
Series.SeriesGroupBy.is_monotonic_increasing
andSeries.SeriesGroupBy.is_monotonic_decreasing
. Followed noatamir/pyladies-berlin-sprints#13 to split the docstrings from Series - but I'm not sure if adding #GH13 to the docstring is correctCouldn't use a variable like {klass} for
item()
to avoid hardcodingSeries
orIndex
.