Skip to content

DOC: Fix quotes position in pandas.core (#24071) #26037

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions pandas/core/groupby/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down Expand Up @@ -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()
Expand Down
11 changes: 7 additions & 4 deletions pandas/core/groupby/groupby.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ class providing the base-class of operations.
{examples}
""")

_pipe_template = """\
_pipe_template = """
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you build the doc for pipe here to make sure this is OK? Just want to be sure that removing the continuation doesn't impact expected indentation during substitution

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one seems OK.

Apply a function `func` with arguments to this %(klass)s object and return
the function's result.

Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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 = """
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar comment here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call, this one is problematic and is leading to reference/groupby.html having descriptions like "Compute first of group values See Also ——– pandas.Series.groupby pandas.DataFrame.groupby pandas.Panel.groupby" rather than simply "Compute first of group values". I will take a look into this.

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
Expand Down