Skip to content

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

Merged
merged 9 commits into from
May 15, 2023
Merged

Conversation

DeaMariaLeon
Copy link
Member

Towards #37875

I couldn't locally build the html files for Series.SeriesGroupBy.is_monotonic_increasing and Series.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 correct

Couldn't use a variable like {klass} for item() to avoid hardcoding Series or Index.

def is_monotonic_increasing(self) -> Series:
# GH13
Copy link
Member

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)

Copy link
Member Author

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.

@DeaMariaLeon
Copy link
Member Author

I can't tell (for sure) if failing tests are related to my changes

Copy link
Member

@MarcoGorelli MarcoGorelli left a 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

Comment on lines +1019 to +1020
>>> s = pd.Series([3, 2, 2, 1])
>>> s.is_monotonic_decreasing
Copy link
Member

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)

Copy link
Member Author

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.

Comment on lines +984 to +985
>>> s.is_unique
False
Copy link
Member

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!

Copy link
Member Author

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

Copy link
Member

@MarcoGorelli MarcoGorelli left a 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

def is_monotonic_decreasing(self) -> Series:
"""
Return boolean if values in the group are monotonically decreasing.
Copy link
Member

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

Copy link
Member Author

Choose a reason for hiding this comment

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

My fault 🫣

Comment on lines 1196 to 1198
Returns
-------
bool
Copy link
Member

Choose a reason for hiding this comment

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

Series

Copy link
Member Author

Choose a reason for hiding this comment

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

Changed

Comment on lines 1175 to 1179
Return boolean if values in the group are monotonically increasing.

Returns
-------
bool
Copy link
Member

Choose a reason for hiding this comment

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

same comment

Copy link
Member Author

Choose a reason for hiding this comment

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

Done

@MarcoGorelli MarcoGorelli added this to the 2.1 milestone May 15, 2023
Copy link
Member

@MarcoGorelli MarcoGorelli left a 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 !

@DeaMariaLeon
Copy link
Member Author

Thanks @MarcoGorelli! - love the cat

@MarcoGorelli MarcoGorelli merged commit f676c5f into pandas-dev:main May 15, 2023
@DeaMariaLeon DeaMariaLeon deleted the examples branch May 15, 2023 14:54
Rylie-W pushed a commit to Rylie-W/pandas that referenced this pull request May 19, 2023
* 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]>
topper-123 pushed a commit to topper-123/pandas that referenced this pull request May 22, 2023
* 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]>
Daquisu pushed a commit to Daquisu/pandas that referenced this pull request Jul 8, 2023
* 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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants