Skip to content

Commit e369bbc

Browse files
committed
DOC: Correct first and last docstring See Also
1 parent a3bfdab commit e369bbc

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
@@ -2226,7 +2226,6 @@ def max(
22262226

22272227
@final
22282228
@Substitution(name="groupby")
2229-
@Appender(_common_see_also)
22302229
def first(self, numeric_only: bool = False, min_count: int = -1):
22312230
"""
22322231
Compute the first non-null entry of each column.
@@ -2245,6 +2244,14 @@ def first(self, numeric_only: bool = False, min_count: int = -1):
22452244
Series or DataFrame
22462245
First not non-null of values within each group.
22472246
2247+
See Also
2248+
--------
2249+
DataFrame.groupby : Apply a function groupby to each row or column of a
2250+
DataFrame.
2251+
DataFrame.core.groupby.GroupBy.last : Compute the last non-null entry of each
2252+
column.
2253+
DataFrame.core.groupby.GroupBy.nth : Take the nth row from each group.
2254+
22482255
Examples
22492256
--------
22502257
>>> df = pd.DataFrame(dict(A=[1, 1, 3], B=[None, 5, 6], C=[1, 2, 3]))
@@ -2253,7 +2260,6 @@ def first(self, numeric_only: bool = False, min_count: int = -1):
22532260
A
22542261
1 5.0 1
22552262
3 6.0 3
2256-
22572263
"""
22582264

22592265
def first_compat(obj: NDFrameT, axis: int = 0):
@@ -2280,7 +2286,6 @@ def first(x: Series):
22802286

22812287
@final
22822288
@Substitution(name="groupby")
2283-
@Appender(_common_see_also)
22842289
def last(self, numeric_only: bool = False, min_count: int = -1):
22852290
"""
22862291
Compute the last non-null entry of each column.
@@ -2299,6 +2304,14 @@ def last(self, numeric_only: bool = False, min_count: int = -1):
22992304
Series or DataFrame
23002305
Last not non-null of values within each group.
23012306
2307+
See Also
2308+
--------
2309+
DataFrame.groupby : Apply a function groupby to each row or column of a
2310+
DataFrame.
2311+
DataFrame.core.groupby.GroupBy.first : Compute the first non-null entry of each
2312+
column.
2313+
DataFrame.core.groupby.GroupBy.nth : Take the nth row from each group.
2314+
23022315
Examples
23032316
--------
23042317
>>> df = pd.DataFrame(dict(A=[1, 1, 3], B=[5, None, 6], C=[1, 2, 3]))

0 commit comments

Comments
 (0)