diff --git a/pandas/core/groupby/generic.py b/pandas/core/groupby/generic.py index 0ab19448043f6..b5aec189700ce 100644 --- a/pandas/core/groupby/generic.py +++ b/pandas/core/groupby/generic.py @@ -709,7 +709,7 @@ def filter(self, func, dropna=True, *args, **kwargs): f : function Function to apply to each subframe. Should return True or False. dropna : Drop groups that do not pass the filter. True by default; - if False, groups that evaluate False are filled with NaNs. + If False, groups that evaluate False are filled with NaNs. Returns ------- diff --git a/pandas/core/groupby/groupby.py b/pandas/core/groupby/groupby.py index 984954fe14bb5..e93ce3ce93164 100644 --- a/pandas/core/groupby/groupby.py +++ b/pandas/core/groupby/groupby.py @@ -212,9 +212,9 @@ class providing the base-class of operations. string indicating the keyword of `callable` that expects the %(klass)s object. args : iterable, optional - positional arguments passed into `func`. + Positional arguments passed into `func`. kwargs : dict, optional - a dictionary of keyword arguments passed into `func`. + A dictionary of keyword arguments passed into `func`. Returns ------- @@ -664,11 +664,11 @@ def get_group(self, name, obj=None): Parameters ---------- name : object - the name of the group to get as a DataFrame + The name of the group to get as a DataFrame. obj : DataFrame, default None - the DataFrame to take the DataFrame out of. If + The DataFrame to take the DataFrame out of. If it is None, the object groupby was called on will - be used + be used. Returns ------- @@ -1114,7 +1114,7 @@ def any(self, skipna=True): Parameters ---------- skipna : bool, default True - Flag to ignore nan values during truth testing + Flag to ignore nan values during truth testing. Returns ------- @@ -1131,7 +1131,7 @@ def all(self, skipna=True): Parameters ---------- skipna : bool, default True - Flag to ignore nan values during truth testing + Flag to ignore nan values during truth testing. Returns ------- @@ -1252,7 +1252,7 @@ def std(self, ddof=1, *args, **kwargs): Parameters ---------- ddof : int, default 1 - degrees of freedom + Degrees of freedom. Returns ------- @@ -1275,7 +1275,7 @@ def var(self, ddof=1, *args, **kwargs): Parameters ---------- ddof : int, default 1 - degrees of freedom + Degrees of freedom. Returns ------- @@ -1310,7 +1310,7 @@ def sem(self, ddof=1): Parameters ---------- ddof : int, default 1 - degrees of freedom + Degrees of freedom. Returns ------- @@ -1622,7 +1622,7 @@ def pad(self, limit=None): Parameters ---------- limit : int, optional - limit of how many values to fill + Limit of how many values to fill. Returns ------- @@ -1648,7 +1648,7 @@ def backfill(self, limit=None): Parameters ---------- limit : int, optional - limit of how many values to fill + Limit of how many values to fill. Returns ------- @@ -1680,10 +1680,10 @@ def nth(self, n: Union[int, List[int]], dropna: Optional[str] = None) -> DataFra Parameters ---------- n : int or list of ints - a single nth value for the row or a list of nth values + A single nth value for the row or a list of nth values. dropna : None or str, optional - apply the specified dropna operation before counting which row is - the nth row. Needs to be None, 'any' or 'all' + Apply the specified dropna operation before counting which row is + the nth row. Needs to be None, 'any' or 'all'. Returns ------- @@ -2098,13 +2098,13 @@ def rank( * first: ranks assigned in order they appear in the array * dense: like 'min', but rank always increases by 1 between groups ascending : bool, default True - False for ranks by high (1) to low (N) + False for ranks by high (1) to low (N). na_option : {'keep', 'top', 'bottom'}, default 'keep' * keep: leave NA values where they are * top: smallest rank if ascending * bottom: smallest rank if descending pct : bool, default False - Compute percentage rank of data within each group + Compute percentage rank of data within each group. axis : int, default 0 The axis of the object over which to compute the rank. @@ -2312,7 +2312,7 @@ def shift(self, periods=1, freq=None, axis=0, fill_value=None): Parameters ---------- periods : int, default 1 - number of periods to shift + Number of periods to shift. freq : frequency string axis : axis to shift, default 0 fill_value : optional