Skip to content

Commit a99d8ee

Browse files
quangngdpmhatre1
authored andcommitted
DOC: RT03 fix for various DataFrameGroupBy and SeriesGroupBy methods (pandas-dev#57862)
* pandas.core.groupby.SeriesGroupBy.apply * pandas.core.groupby.GroupBy.apply * rm check * add a bunch * fix * fix * wip * update pandas.core.groupby.DataFrameGroupBy.resample * rm check from code_checls * minor
1 parent a2f6131 commit a99d8ee

File tree

3 files changed

+21
-29
lines changed

3 files changed

+21
-29
lines changed

ci/code_checks.sh

+3-23
Original file line numberDiff line numberDiff line change
@@ -667,60 +667,40 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
667667
-i "pandas.core.groupby.DataFrameGroupBy.__iter__ RT03,SA01" \
668668
-i "pandas.core.groupby.DataFrameGroupBy.agg RT03" \
669669
-i "pandas.core.groupby.DataFrameGroupBy.aggregate RT03" \
670-
-i "pandas.core.groupby.DataFrameGroupBy.apply RT03" \
671670
-i "pandas.core.groupby.DataFrameGroupBy.boxplot PR07,RT03,SA01" \
672-
-i "pandas.core.groupby.DataFrameGroupBy.cummax RT03" \
673-
-i "pandas.core.groupby.DataFrameGroupBy.cummin RT03" \
674-
-i "pandas.core.groupby.DataFrameGroupBy.cumprod RT03" \
675-
-i "pandas.core.groupby.DataFrameGroupBy.cumsum RT03" \
676-
-i "pandas.core.groupby.DataFrameGroupBy.filter RT03,SA01" \
671+
-i "pandas.core.groupby.DataFrameGroupBy.filter SA01" \
677672
-i "pandas.core.groupby.DataFrameGroupBy.get_group RT03,SA01" \
678673
-i "pandas.core.groupby.DataFrameGroupBy.groups SA01" \
679674
-i "pandas.core.groupby.DataFrameGroupBy.hist RT03" \
680675
-i "pandas.core.groupby.DataFrameGroupBy.indices SA01" \
681676
-i "pandas.core.groupby.DataFrameGroupBy.max SA01" \
682-
-i "pandas.core.groupby.DataFrameGroupBy.mean RT03" \
683677
-i "pandas.core.groupby.DataFrameGroupBy.median SA01" \
684678
-i "pandas.core.groupby.DataFrameGroupBy.min SA01" \
685679
-i "pandas.core.groupby.DataFrameGroupBy.nth PR02" \
686-
-i "pandas.core.groupby.DataFrameGroupBy.nunique RT03,SA01" \
680+
-i "pandas.core.groupby.DataFrameGroupBy.nunique SA01" \
687681
-i "pandas.core.groupby.DataFrameGroupBy.ohlc SA01" \
688682
-i "pandas.core.groupby.DataFrameGroupBy.plot PR02,SA01" \
689683
-i "pandas.core.groupby.DataFrameGroupBy.prod SA01" \
690-
-i "pandas.core.groupby.DataFrameGroupBy.rank RT03" \
691-
-i "pandas.core.groupby.DataFrameGroupBy.resample RT03" \
692684
-i "pandas.core.groupby.DataFrameGroupBy.sem SA01" \
693-
-i "pandas.core.groupby.DataFrameGroupBy.skew RT03" \
694685
-i "pandas.core.groupby.DataFrameGroupBy.sum SA01" \
695-
-i "pandas.core.groupby.DataFrameGroupBy.transform RT03" \
696686
-i "pandas.core.groupby.SeriesGroupBy.__iter__ RT03,SA01" \
697687
-i "pandas.core.groupby.SeriesGroupBy.agg RT03" \
698688
-i "pandas.core.groupby.SeriesGroupBy.aggregate RT03" \
699-
-i "pandas.core.groupby.SeriesGroupBy.apply RT03" \
700-
-i "pandas.core.groupby.SeriesGroupBy.cummax RT03" \
701-
-i "pandas.core.groupby.SeriesGroupBy.cummin RT03" \
702-
-i "pandas.core.groupby.SeriesGroupBy.cumprod RT03" \
703-
-i "pandas.core.groupby.SeriesGroupBy.cumsum RT03" \
704-
-i "pandas.core.groupby.SeriesGroupBy.filter PR01,RT03,SA01" \
689+
-i "pandas.core.groupby.SeriesGroupBy.filter PR01,SA01" \
705690
-i "pandas.core.groupby.SeriesGroupBy.get_group RT03,SA01" \
706691
-i "pandas.core.groupby.SeriesGroupBy.groups SA01" \
707692
-i "pandas.core.groupby.SeriesGroupBy.indices SA01" \
708693
-i "pandas.core.groupby.SeriesGroupBy.is_monotonic_decreasing SA01" \
709694
-i "pandas.core.groupby.SeriesGroupBy.is_monotonic_increasing SA01" \
710695
-i "pandas.core.groupby.SeriesGroupBy.max SA01" \
711-
-i "pandas.core.groupby.SeriesGroupBy.mean RT03" \
712696
-i "pandas.core.groupby.SeriesGroupBy.median SA01" \
713697
-i "pandas.core.groupby.SeriesGroupBy.min SA01" \
714698
-i "pandas.core.groupby.SeriesGroupBy.nth PR02" \
715699
-i "pandas.core.groupby.SeriesGroupBy.ohlc SA01" \
716700
-i "pandas.core.groupby.SeriesGroupBy.plot PR02,SA01" \
717701
-i "pandas.core.groupby.SeriesGroupBy.prod SA01" \
718-
-i "pandas.core.groupby.SeriesGroupBy.rank RT03" \
719-
-i "pandas.core.groupby.SeriesGroupBy.resample RT03" \
720702
-i "pandas.core.groupby.SeriesGroupBy.sem SA01" \
721-
-i "pandas.core.groupby.SeriesGroupBy.skew RT03" \
722703
-i "pandas.core.groupby.SeriesGroupBy.sum SA01" \
723-
-i "pandas.core.groupby.SeriesGroupBy.transform RT03" \
724704
-i "pandas.core.resample.Resampler.__iter__ RT03,SA01" \
725705
-i "pandas.core.resample.Resampler.ffill RT03" \
726706
-i "pandas.core.resample.Resampler.get_group RT03,SA01" \

pandas/core/groupby/generic.py

+6
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,7 @@ def apply(self, func, *args, **kwargs) -> Series:
240240
Returns
241241
-------
242242
Series or DataFrame
243+
A pandas object with the result of applying ``func`` to each group.
243244
244245
See Also
245246
--------
@@ -600,6 +601,7 @@ def filter(self, func, dropna: bool = True, *args, **kwargs):
600601
Returns
601602
-------
602603
Series
604+
The filtered subset of the original Series.
603605
604606
Notes
605607
-----
@@ -1078,6 +1080,7 @@ def skew(
10781080
Returns
10791081
-------
10801082
Series
1083+
Unbiased skew within groups.
10811084
10821085
See Also
10831086
--------
@@ -1941,6 +1944,7 @@ def filter(self, func, dropna: bool = True, *args, **kwargs) -> DataFrame:
19411944
Returns
19421945
-------
19431946
DataFrame
1947+
The filtered subset of the original DataFrame.
19441948
19451949
Notes
19461950
-----
@@ -2108,6 +2112,7 @@ def nunique(self, dropna: bool = True) -> DataFrame:
21082112
Returns
21092113
-------
21102114
nunique: DataFrame
2115+
Counts of unique elements in each position.
21112116
21122117
Examples
21132118
--------
@@ -2506,6 +2511,7 @@ def skew(
25062511
Returns
25072512
-------
25082513
DataFrame
2514+
Unbiased skew within groups.
25092515
25102516
See Also
25112517
--------

pandas/core/groupby/groupby.py

+12-6
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,8 @@ class providing the base-class of operations.
333333
Returns
334334
-------
335335
%(klass)s
336+
%(klass)s with the same indexes as the original object filled
337+
with transformed values.
336338
337339
See Also
338340
--------
@@ -1551,6 +1553,7 @@ def apply(self, func, *args, include_groups: bool = True, **kwargs) -> NDFrameT:
15511553
Returns
15521554
-------
15531555
Series or DataFrame
1556+
A pandas object with the result of applying ``func`` to each group.
15541557
15551558
See Also
15561559
--------
@@ -2245,6 +2248,7 @@ def mean(
22452248
Returns
22462249
-------
22472250
pandas.Series or pandas.DataFrame
2251+
Mean of values within each group. Same object type as the caller.
22482252
%(see_also)s
22492253
Examples
22502254
--------
@@ -3512,11 +3516,8 @@ def resample(self, rule, *args, include_groups: bool = True, **kwargs) -> Resamp
35123516
35133517
Returns
35143518
-------
3515-
pandas.api.typing.DatetimeIndexResamplerGroupby,
3516-
pandas.api.typing.PeriodIndexResamplerGroupby, or
3517-
pandas.api.typing.TimedeltaIndexResamplerGroupby
3518-
Return a new groupby object, with type depending on the data
3519-
being resampled.
3519+
DatetimeIndexResampler, PeriodIndexResampler or TimdeltaResampler
3520+
Resampler object for the type of the index.
35203521
35213522
See Also
35223523
--------
@@ -4591,7 +4592,8 @@ def rank(
45914592
45924593
Returns
45934594
-------
4594-
DataFrame with ranking of values within each group
4595+
DataFrame
4596+
The ranking of values within each group.
45954597
%(see_also)s
45964598
Examples
45974599
--------
@@ -4663,6 +4665,7 @@ def cumprod(self, *args, **kwargs) -> NDFrameT:
46634665
Returns
46644666
-------
46654667
Series or DataFrame
4668+
Cumulative product for each group. Same object type as the caller.
46664669
%(see_also)s
46674670
Examples
46684671
--------
@@ -4721,6 +4724,7 @@ def cumsum(self, *args, **kwargs) -> NDFrameT:
47214724
Returns
47224725
-------
47234726
Series or DataFrame
4727+
Cumulative sum for each group. Same object type as the caller.
47244728
%(see_also)s
47254729
Examples
47264730
--------
@@ -4783,6 +4787,7 @@ def cummin(
47834787
Returns
47844788
-------
47854789
Series or DataFrame
4790+
Cumulative min for each group. Same object type as the caller.
47864791
%(see_also)s
47874792
Examples
47884793
--------
@@ -4853,6 +4858,7 @@ def cummax(
48534858
Returns
48544859
-------
48554860
Series or DataFrame
4861+
Cumulative max for each group. Same object type as the caller.
48564862
%(see_also)s
48574863
Examples
48584864
--------

0 commit comments

Comments
 (0)