-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
DOC: sort has no effect on filters #51825
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
In the API docs for DataFrame.groupby and Series.groupby the fact that |
pandas/core/shared_docs.py
Outdated
This argument has no effect on some aggregating functions, such as | ||
:ref:`head, tail <basics.aggregate>` and ``nth[:]``. |
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.
it might be good to mention "filtrations" rather than "some aggregating functions", and link to the "filtrations" section introduced in https://github.com/pandas-dev/pandas/pull/51704/files?
as yes, it might be good to note it in as_index
too
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 did as you suggested. I think ci failures aren't 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.
thanks!
not sure, it's showing
/home/runner/work/pandas/pandas/pandas/core/frame.py:docstring of pandas.core.frame.DataFrame.groupby:210: WARNING: Duplicate explicit target name: "groupby user guide".
/home/runner/work/pandas/pandas/pandas/core/frame.py:docstring of pandas.core.frame.DataFrame.groupby:210: WARNING: Duplicate explicit target name: "groupby user guide".
/home/runner/work/pandas/pandas/pandas/core/series.py:docstring of pandas.core.series.Series.groupby:188: WARNING: Duplicate explicit target name: "groupby user guide".
/home/runner/work/pandas/pandas/pandas/core/series.py:docstring of pandas.core.series.Series.groupby:188: WARNING: Duplicate explicit target name: "groupby user guide".
which might be due to the link you wrote?
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.
Thank you for the comment. I agree, the warnings are related to my changes. There are two different links in one doctsring with the same name, which causes the problem. I changed the name of my link.
It’s interesting, while I run validation
python scripts/validate_docstrings.py pandas.core.groupby.DataFrameGroupBy
and
python scripts/validate_docstrings.py pandas.core.groupby.SeriesGroupBy
there were no warnings.
After validation, I cleaned and built new documentation locally. Then I just checked html, my links worked right. My mistake, I should check warnings raised by the build.
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 for the PR!
pandas/core/shared_docs.py
Outdated
@@ -114,11 +114,17 @@ | |||
as_index : bool, default True | |||
For aggregated output, return object with group labels as the |
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.
With your addition (if we add in transformations, see below), I think "For aggregated output," can be removed. But I'm also okay with it staying as well.
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 removed "For aggregated output,". With my addition, there is no need to write this.
pandas/core/shared_docs.py
Outdated
effectively "SQL-style" grouped output. This argument has no effect | ||
on filtrations (see the `filtration user guide | ||
<https://pandas.pydata.org/docs/dev/user_guide/groupby.html#filtration>`_), | ||
such as ``head()``, ``tail()`` and ``nth()``. |
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.
Can you add in transformations here as well?
I would describe it as "filtrations in the user guide" rather than "filteration user guide"; what do you think?
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 agree, "filtrations in the user guide" sounds more correct and more clear.
pandas/core/shared_docs.py
Outdated
This argument has no effect on filtrations (see the `filtration user guide | ||
<https://pandas.pydata.org/docs/dev/user_guide/groupby.html#filtration>`_), | ||
such as ``head()``, ``tail()`` and ``nth()``. |
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.
Similar remarks here.
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.
Changes look good, just waiting on the docs build to double check the output.
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.
lgtm
@MarcoGorelli - any further comments? |
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, thanks @natmokval and @rhshadrach !
shipping it then
Thanks @MarcoGorelli and @rhshadrach for helping me with this pr. |
Updated docs for
DataFrame.groupby
andSeries.groupby
, pointed out that the parameter thesort
parameter has no effect on filters.