diff --git a/pandas/core/groupby/generic.py b/pandas/core/groupby/generic.py index a1c1163435611..e2de9469cc01d 100644 --- a/pandas/core/groupby/generic.py +++ b/pandas/core/groupby/generic.py @@ -727,9 +727,9 @@ def _transform_general( def filter(self, func, dropna: bool = True, *args, **kwargs): """ - Filter elements from groups that don't satisfy a criterion. + Filter groups that don't satisfy a criterion. - Elements from groups are filtered if they do not satisfy the + Groups are filtered if they do not satisfy the boolean criterion specified by func. Parameters @@ -752,7 +752,7 @@ def filter(self, func, dropna: bool = True, *args, **kwargs): See Also -------- Series.filter: Filter elements of ungrouped Series. - DataFrameGroupBy.filter : Filter elements from groups base on criterion. + DataFrameGroupBy.filter : Filter groups base on criterion. Notes ----- @@ -2335,9 +2335,9 @@ def _choose_path(self, fast_path: Callable, slow_path: Callable, group: DataFram def filter(self, func, dropna: bool = True, *args, **kwargs) -> DataFrame: """ - Filter elements from groups that don't satisfy a criterion. + Filter groups that don't satisfy a criterion. - Elements from groups are filtered if they do not satisfy the + Groups are filtered if they do not satisfy the boolean criterion specified by func. Parameters @@ -2360,7 +2360,7 @@ def filter(self, func, dropna: bool = True, *args, **kwargs) -> DataFrame: See Also -------- DataFrame.filter: Filter elements of ungrouped DataFrame. - SeriesGroupBy.filter : Filter elements from groups base on criterion. + SeriesGroupBy.filter : Filter groups based on criterion. Notes -----