Skip to content

DOC: fix See Also constructs #26059

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

Merged
Merged
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
12 changes: 8 additions & 4 deletions pandas/core/groupby/groupby.py
Original file line number Diff line number Diff line change
Expand Up @@ -1097,7 +1097,8 @@ def count(self):
# defined here for API doc
raise NotImplementedError

@Substitution(name='groupby', see_also=_common_see_also)
@Substitution(name='groupby')
@Substitution(see_also=_common_see_also)
Copy link
Member Author

Choose a reason for hiding this comment

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

If done there are also %name occurences in the _common_see_also that need to be substituted, so they cannot be done in one go.

def mean(self, *args, **kwargs):
"""
Compute mean of groups, excluding missing values.
Expand Down Expand Up @@ -1543,7 +1544,8 @@ def backfill(self, limit=None):
return self._fill('bfill', limit=limit)
bfill = backfill

@Substitution(name='groupby', see_also=_common_see_also)
@Substitution(name='groupby')
@Substitution(see_also=_common_see_also)
def nth(self, n, dropna=None):
"""
Take the nth row from each group if n is an int, or a subset of rows
Expand Down Expand Up @@ -2130,7 +2132,8 @@ def pct_change(self, periods=1, fill_method='pad', limit=None, freq=None,
shifted = fill_grp.shift(periods=periods, freq=freq)
return (filled / shifted) - 1

@Substitution(name='groupby', see_also=_common_see_also)
@Substitution(name='groupby')
@Substitution(see_also=_common_see_also)
def head(self, n=5):
"""
Return first n rows of each group.
Expand All @@ -2156,7 +2159,8 @@ def head(self, n=5):
mask = self._cumcount_array() < n
return self._selected_obj[mask]

@Substitution(name='groupby', see_also=_common_see_also)
@Substitution(name='groupby')
@Substitution(see_also=_common_see_also)
def tail(self, n=5):
"""
Return last n rows of each group.
Expand Down
2 changes: 0 additions & 2 deletions pandas/core/indexes/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -3624,8 +3624,6 @@ def values(self):
--------
Index.array : Reference to the underlying data.
Index.to_numpy : A NumPy array representing the underlying data.

Return the underlying data as an ndarray.
Copy link
Member Author

Choose a reason for hiding this comment

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

left-over from the old docstring

"""
return self._data.view(np.ndarray)

Expand Down