Skip to content

Commit 33125c9

Browse files
committed
DOC: Correct first and last docstring See Also
1 parent 4bcb125 commit 33125c9

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

pandas/core/groupby/groupby.py

+16-3
Original file line numberDiff line numberDiff line change
@@ -2236,7 +2236,6 @@ def max(
22362236

22372237
@final
22382238
@Substitution(name="groupby")
2239-
@Appender(_common_see_also)
22402239
def first(self, numeric_only: bool = False, min_count: int = -1):
22412240
"""
22422241
Compute the first non-null entry of each column.
@@ -2255,6 +2254,14 @@ def first(self, numeric_only: bool = False, min_count: int = -1):
22552254
Series or DataFrame
22562255
First not non-null of values within each group.
22572256
2257+
See Also
2258+
--------
2259+
DataFrame.groupby : Apply a function groupby to each row or column of a
2260+
DataFrame.
2261+
DataFrame.core.groupby.GroupBy.last : Compute the last non-null entry of each
2262+
column.
2263+
DataFrame.core.groupby.GroupBy.nth : Take the nth row from each group.
2264+
22582265
Examples
22592266
--------
22602267
>>> df = pd.DataFrame(dict(A=[1, 1, 3], B=[None, 5, 6], C=[1, 2, 3]))
@@ -2263,7 +2270,6 @@ def first(self, numeric_only: bool = False, min_count: int = -1):
22632270
A
22642271
1 5.0 1
22652272
3 6.0 3
2266-
22672273
"""
22682274

22692275
def first_compat(obj: NDFrameT, axis: int = 0):
@@ -2290,7 +2296,6 @@ def first(x: Series):
22902296

22912297
@final
22922298
@Substitution(name="groupby")
2293-
@Appender(_common_see_also)
22942299
def last(self, numeric_only: bool = False, min_count: int = -1):
22952300
"""
22962301
Compute the last non-null entry of each column.
@@ -2309,6 +2314,14 @@ def last(self, numeric_only: bool = False, min_count: int = -1):
23092314
Series or DataFrame
23102315
Last not non-null of values within each group.
23112316
2317+
See Also
2318+
--------
2319+
DataFrame.groupby : Apply a function groupby to each row or column of a
2320+
DataFrame.
2321+
DataFrame.core.groupby.GroupBy.first : Compute the first non-null entry of each
2322+
column.
2323+
DataFrame.core.groupby.GroupBy.nth : Take the nth row from each group.
2324+
23122325
Examples
23132326
--------
23142327
>>> df = pd.DataFrame(dict(A=[1, 1, 3], B=[5, None, 6], C=[1, 2, 3]))

0 commit comments

Comments
 (0)