Skip to content

DOC: RT03 fix for various DataFrameGroupBy and SeriesGroupBy methods #57862

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 11 commits into from
Apr 1, 2024
Merged
22 changes: 0 additions & 22 deletions ci/code_checks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -760,34 +760,12 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
pandas.core.groupby.DataFrameGroupBy.aggregate\
pandas.core.groupby.DataFrameGroupBy.apply\
pandas.core.groupby.DataFrameGroupBy.boxplot\
pandas.core.groupby.DataFrameGroupBy.cummax\
pandas.core.groupby.DataFrameGroupBy.cummin\
pandas.core.groupby.DataFrameGroupBy.cumprod\
pandas.core.groupby.DataFrameGroupBy.cumsum\
pandas.core.groupby.DataFrameGroupBy.filter\
pandas.core.groupby.DataFrameGroupBy.get_group\
pandas.core.groupby.DataFrameGroupBy.hist\
pandas.core.groupby.DataFrameGroupBy.mean\
pandas.core.groupby.DataFrameGroupBy.nunique\
pandas.core.groupby.DataFrameGroupBy.rank\
pandas.core.groupby.DataFrameGroupBy.resample\
pandas.core.groupby.DataFrameGroupBy.skew\
pandas.core.groupby.DataFrameGroupBy.transform\
pandas.core.groupby.SeriesGroupBy.__iter__\
pandas.core.groupby.SeriesGroupBy.agg\
pandas.core.groupby.SeriesGroupBy.aggregate\
pandas.core.groupby.SeriesGroupBy.apply\
pandas.core.groupby.SeriesGroupBy.cummax\
pandas.core.groupby.SeriesGroupBy.cummin\
pandas.core.groupby.SeriesGroupBy.cumprod\
pandas.core.groupby.SeriesGroupBy.cumsum\
pandas.core.groupby.SeriesGroupBy.filter\
pandas.core.groupby.SeriesGroupBy.get_group\
pandas.core.groupby.SeriesGroupBy.mean\
pandas.core.groupby.SeriesGroupBy.rank\
pandas.core.groupby.SeriesGroupBy.resample\
pandas.core.groupby.SeriesGroupBy.skew\
pandas.core.groupby.SeriesGroupBy.transform\
pandas.core.resample.Resampler.__iter__\
pandas.core.resample.Resampler.ffill\
pandas.core.resample.Resampler.get_group\
Expand Down
6 changes: 6 additions & 0 deletions pandas/core/groupby/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,7 @@ def apply(self, func, *args, **kwargs) -> Series:
Returns
-------
Series or DataFrame
A pandas object with the result of applying ``func`` to each group.

See Also
--------
Expand Down Expand Up @@ -600,6 +601,7 @@ def filter(self, func, dropna: bool = True, *args, **kwargs):
Returns
-------
Series
The filtered subset of the original Series.

Notes
-----
Expand Down Expand Up @@ -1078,6 +1080,7 @@ def skew(
Returns
-------
Series
Unbiased skew within groups.

See Also
--------
Expand Down Expand Up @@ -1939,6 +1942,7 @@ def filter(self, func, dropna: bool = True, *args, **kwargs) -> DataFrame:
Returns
-------
DataFrame
The filtered subset of the original DataFrame.

Notes
-----
Expand Down Expand Up @@ -2106,6 +2110,7 @@ def nunique(self, dropna: bool = True) -> DataFrame:
Returns
-------
nunique: DataFrame
Counts of unique elements in each position.

Examples
--------
Expand Down Expand Up @@ -2504,6 +2509,7 @@ def skew(
Returns
-------
DataFrame
Unbiased skew within groups.

See Also
--------
Expand Down
20 changes: 15 additions & 5 deletions pandas/core/groupby/groupby.py
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,8 @@ class providing the base-class of operations.
Returns
-------
%(klass)s
%(klass)s with the same indexes as the original object filled
with transformed values.

See Also
--------
Expand Down Expand Up @@ -1550,6 +1552,7 @@ def apply(self, func, *args, include_groups: bool = True, **kwargs) -> NDFrameT:
Returns
-------
Series or DataFrame
A pandas object with the result of applying ``func`` to each group.

See Also
--------
Expand Down Expand Up @@ -2244,6 +2247,7 @@ def mean(
Returns
-------
pandas.Series or pandas.DataFrame
Mean of values within each group. Same object type as the caller.
%(see_also)s
Examples
--------
Expand Down Expand Up @@ -3511,11 +3515,12 @@ def resample(self, rule, *args, include_groups: bool = True, **kwargs) -> Resamp

Returns
-------
pandas.api.typing.DatetimeIndexResamplerGroupby,
pandas.api.typing.PeriodIndexResamplerGroupby, or
pandas.api.typing.TimedeltaIndexResamplerGroupby
pandas.api.typing.DatetimeIndexResampler
Return a new groupby object, with type depending on the data
being resampled.
being resampled:
- pandas.api.typing.DatetimeIndexResamplerGroupby
- pandas.api.typing.PeriodIndexResamplerGroupby
- pandas.api.typing.TimedeltaIndexResamplerGroupby
Copy link
Member

Choose a reason for hiding this comment

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

This doesn't seem to be rendering correctly: https://pandas.pydata.org/preview/pandas-dev/pandas/57862/docs/reference/api/pandas.core.groupby.DataFrameGroupBy.resample.html#pandas.core.groupby.DataFrameGroupBy.resample

Also, the type is incorrect now. Why don't you leave as type simply: DatetimeIndexResampler, PeriodIndexResampler or TimdeltaResampler

And in the description you can have something like Resampler object for the type of the index.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated. But i'll hold this up and wait for the new flow regarding alll this doc-related thingy


See Also
--------
Expand Down Expand Up @@ -4590,7 +4595,8 @@ def rank(

Returns
-------
DataFrame with ranking of values within each group
DataFrame
The ranking of values within each group.
%(see_also)s
Examples
--------
Expand Down Expand Up @@ -4662,6 +4668,7 @@ def cumprod(self, *args, **kwargs) -> NDFrameT:
Returns
-------
Series or DataFrame
Cumulative product for each group. Same object type as the caller.
%(see_also)s
Examples
--------
Expand Down Expand Up @@ -4720,6 +4727,7 @@ def cumsum(self, *args, **kwargs) -> NDFrameT:
Returns
-------
Series or DataFrame
Cumulative sum for each group. Same object type as the caller.
%(see_also)s
Examples
--------
Expand Down Expand Up @@ -4782,6 +4790,7 @@ def cummin(
Returns
-------
Series or DataFrame
Cumulative min for each group. Same object type as the caller.
%(see_also)s
Examples
--------
Expand Down Expand Up @@ -4852,6 +4861,7 @@ def cummax(
Returns
-------
Series or DataFrame
Cumulative max for each group. Same object type as the caller.
%(see_also)s
Examples
--------
Expand Down
Loading