diff --git a/pandas/core/groupby/generic.py b/pandas/core/groupby/generic.py index f8b9ddce6000e..d5935fd65fd28 100644 --- a/pandas/core/groupby/generic.py +++ b/pandas/core/groupby/generic.py @@ -1181,7 +1181,9 @@ def value_counts(self, normalize=False, sort=True, ascending=False, return Series(out, index=mi, name=self._selection_name) def count(self): - """ Compute count of group, excluding missing values """ + """ + Compute count of group, excluding missing values + """ ids, _, ngroups = self.grouper.group_info val = self.obj.get_values() @@ -1479,7 +1481,9 @@ def _fill(self, direction, limit=None): return concat((self._wrap_transformed_output(output), res), axis=1) def count(self): - """ Compute count of group, excluding missing values """ + """ + Compute count of group, excluding missing values + """ from pandas.core.dtypes.missing import _isna_ndarraylike as _isna data, _ = self._get_data_to_aggregate() diff --git a/pandas/core/groupby/groupby.py b/pandas/core/groupby/groupby.py index bd8a8852964e3..45113511319f5 100644 --- a/pandas/core/groupby/groupby.py +++ b/pandas/core/groupby/groupby.py @@ -172,7 +172,7 @@ class providing the base-class of operations. {examples} """) -_pipe_template = """\ +_pipe_template = """ Apply a function `func` with arguments to this %(klass)s object and return the function's result. @@ -557,7 +557,8 @@ def __getattr__(self, attr): B A a 2 -b 2""") +b 2 +""") @Appender(_pipe_template) def pipe(self, func, *args, **kwargs): return com._pipe(self, func, *args, **kwargs) @@ -1257,11 +1258,13 @@ def groupby_function(name, alias, npfunc, numeric_only=True, _convert=False, min_count=-1): - _local_template = "Compute %(f)s of group values" + _local_template = """ + Compute %(f)s of group values + """ @Substitution(name='groupby', f=name) @Appender(_common_see_also) - @Appender(_local_template) + @Appender(_local_template, join='\n') def f(self, **kwargs): if 'numeric_only' not in kwargs: kwargs['numeric_only'] = numeric_only