Skip to content

Commit ea22788

Browse files
authored
DOCS: fix docstring validation errors for groupby.DataFrameGroupBy.filter, groupby.SeriesGroupBy.filter (#59742)
* DOCS: fix docstring validation errors for pandas.core.groupby.DataFrameGroupBy.filter DOC string fix for both groupby.DataFrameGroupBy.filter and groupby.SeriesGroupBy.filter * Update generic.py * Update generic.py * Update generic.py * quickfix
1 parent f3d19fb commit ea22788

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed

ci/code_checks.sh

-2
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
156156
-i "pandas.core.groupby.DataFrameGroupBy.agg RT03" \
157157
-i "pandas.core.groupby.DataFrameGroupBy.aggregate RT03" \
158158
-i "pandas.core.groupby.DataFrameGroupBy.boxplot PR07,RT03,SA01" \
159-
-i "pandas.core.groupby.DataFrameGroupBy.filter SA01" \
160159
-i "pandas.core.groupby.DataFrameGroupBy.get_group RT03,SA01" \
161160
-i "pandas.core.groupby.DataFrameGroupBy.groups SA01" \
162161
-i "pandas.core.groupby.DataFrameGroupBy.hist RT03" \
@@ -172,7 +171,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
172171
-i "pandas.core.groupby.SeriesGroupBy.__iter__ RT03,SA01" \
173172
-i "pandas.core.groupby.SeriesGroupBy.agg RT03" \
174173
-i "pandas.core.groupby.SeriesGroupBy.aggregate RT03" \
175-
-i "pandas.core.groupby.SeriesGroupBy.filter PR01,SA01" \
176174
-i "pandas.core.groupby.SeriesGroupBy.get_group RT03,SA01" \
177175
-i "pandas.core.groupby.SeriesGroupBy.groups SA01" \
178176
-i "pandas.core.groupby.SeriesGroupBy.indices SA01" \

pandas/core/groupby/generic.py

+15-3
Original file line numberDiff line numberDiff line change
@@ -600,15 +600,23 @@ def filter(self, func, dropna: bool = True, *args, **kwargs):
600600
----------
601601
func : function
602602
Criterion to apply to each group. Should return True or False.
603-
dropna : bool
603+
dropna : bool, optional
604604
Drop groups that do not pass the filter. True by default; if False,
605605
groups that evaluate False are filled with NaNs.
606+
*args : tuple
607+
Optional positional arguments to pass to `func`.
608+
**kwargs : dict
609+
Optional keyword arguments to pass to `func`.
606610
607611
Returns
608612
-------
609613
Series
610614
The filtered subset of the original Series.
611615
616+
See Also
617+
--------
618+
DataFrameGroupBy.filter : Filter elements from groups base on criterion.
619+
612620
Notes
613621
-----
614622
Functions that mutate the passed object can produce unexpected
@@ -1943,16 +1951,20 @@ def filter(self, func, dropna: bool = True, *args, **kwargs) -> DataFrame:
19431951
dropna : bool
19441952
Drop groups that do not pass the filter. True by default; if False,
19451953
groups that evaluate False are filled with NaNs.
1946-
*args
1954+
*args : tuple
19471955
Additional positional arguments to pass to `func`.
1948-
**kwargs
1956+
**kwargs : dict
19491957
Additional keyword arguments to pass to `func`.
19501958
19511959
Returns
19521960
-------
19531961
DataFrame
19541962
The filtered subset of the original DataFrame.
19551963
1964+
See Also
1965+
--------
1966+
SeriesGroupBy.filter : Filter elements from groups base on criterion.
1967+
19561968
Notes
19571969
-----
19581970
Each subframe is endowed the attribute 'name' in case you need to know

0 commit comments

Comments
 (0)