python-pandas/26059.patch
2019-06-27 03:22:25 -04:00

72 lines
2.6 KiB
Diff

From 0ec909fca98ee5854f5865dd782d1aff99492ae6 Mon Sep 17 00:00:00 2001
From: Joris Van den Bossche <jorisvandenbossche@gmail.com>
Date: Fri, 12 Apr 2019 16:36:54 +0200
Subject: [PATCH] DOC: fix See Also constructs (#26059)
Signed-off-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
---
pandas/core/groupby/groupby.py | 12 ++++++++----
pandas/core/indexes/base.py | 2 --
2 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/pandas/core/groupby/groupby.py b/pandas/core/groupby/groupby.py
index 8766fdbc2..0c3eaee8c 100644
--- a/pandas/core/groupby/groupby.py
+++ b/pandas/core/groupby/groupby.py
@@ -1079,7 +1079,8 @@ class GroupBy(_GroupBy):
# defined here for API doc
raise NotImplementedError
- @Substitution(name='groupby', see_also=_common_see_also)
+ @Substitution(name='groupby')
+ @Substitution(see_also=_common_see_also)
def mean(self, *args, **kwargs):
"""
Compute mean of groups, excluding missing values.
@@ -1527,7 +1528,8 @@ class GroupBy(_GroupBy):
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
@@ -2036,7 +2038,8 @@ class GroupBy(_GroupBy):
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):
"""
Returns first n rows of each group.
@@ -2064,7 +2067,8 @@ class GroupBy(_GroupBy):
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):
"""
Returns last n rows of each group.
diff --git a/pandas/core/indexes/base.py b/pandas/core/indexes/base.py
index 2fa034670..4ec2e56d0 100644
--- a/pandas/core/indexes/base.py
+++ b/pandas/core/indexes/base.py
@@ -3623,8 +3623,6 @@ class Index(IndexOpsMixin, PandasObject):
--------
Index.array : Reference to the underlying data.
Index.to_numpy : A NumPy array representing the underlying data.
-
- Return the underlying data as an ndarray.
"""
return self._data.view(np.ndarray)
--
2.21.0