Skip to content

Commit 4bcb125

Browse files
committed
DOC: Correct groupby.last does not use nulls
1 parent e2b56cd commit 4bcb125

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pandas/core/groupby/groupby.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2307,12 +2307,12 @@ def last(self, numeric_only: bool = False, min_count: int = -1):
23072307
Returns
23082308
-------
23092309
Series or DataFrame
2310-
First not non-null of values within each group.
2310+
Last not non-null of values within each group.
23112311
23122312
Examples
23132313
--------
23142314
>>> df = pd.DataFrame(dict(A=[1, 1, 3], B=[5, None, 6], C=[1, 2, 3]))
2315-
>>> df.groupby("A").first()
2315+
>>> df.groupby("A").last()
23162316
B C
23172317
A
23182318
1 5.0 2

0 commit comments

Comments
 (0)