Skip to content

Commit f111fbd

Browse files
ivanpan0626ammar-qazi
authored andcommitted
DOCS: fix docstring validation errors for groupby.DataFrameGroupBy.filter, groupby.SeriesGroupBy.filter (pandas-dev#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 6e61149 commit f111fbd

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
@@ -162,7 +162,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
162162
-i "pandas.core.groupby.DataFrameGroupBy.agg RT03" \
163163
-i "pandas.core.groupby.DataFrameGroupBy.aggregate RT03" \
164164
-i "pandas.core.groupby.DataFrameGroupBy.boxplot PR07,RT03,SA01" \
165-
-i "pandas.core.groupby.DataFrameGroupBy.filter SA01" \
166165
-i "pandas.core.groupby.DataFrameGroupBy.get_group RT03,SA01" \
167166
-i "pandas.core.groupby.DataFrameGroupBy.groups SA01" \
168167
-i "pandas.core.groupby.DataFrameGroupBy.hist RT03" \
@@ -178,7 +177,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
178177
-i "pandas.core.groupby.SeriesGroupBy.__iter__ RT03,SA01" \
179178
-i "pandas.core.groupby.SeriesGroupBy.agg RT03" \
180179
-i "pandas.core.groupby.SeriesGroupBy.aggregate RT03" \
181-
-i "pandas.core.groupby.SeriesGroupBy.filter PR01,SA01" \
182180
-i "pandas.core.groupby.SeriesGroupBy.get_group RT03,SA01" \
183181
-i "pandas.core.groupby.SeriesGroupBy.groups SA01" \
184182
-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)