Skip to content

Commit 9929973

Browse files
committed
Merge pull request #9333 from kidphys/groupby.tail.docfix
Fix docs in groupby.tail
2 parents 0a444d3 + ab926b6 commit 9929973

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

pandas/core/groupby.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -997,16 +997,16 @@ def tail(self, n=5):
997997
Examples
998998
--------
999999
1000-
>>> df = DataFrame([[1, 2], [1, 4], [5, 6]],
1000+
>>> df = DataFrame([['a', 1], ['a', 2], ['b', 1], ['b', 2]],
10011001
columns=['A', 'B'])
1002-
>>> df.groupby('A', as_index=False).tail(1)
1002+
>>> df.groupby('A').tail(1)
10031003
A B
1004-
0 1 2
1005-
2 5 6
1004+
1 a 2
1005+
3 b 2
10061006
>>> df.groupby('A').head(1)
10071007
A B
1008-
0 1 2
1009-
2 5 6
1008+
0 a 1
1009+
2 b 1
10101010
10111011
"""
10121012
obj = self._selected_obj

0 commit comments

Comments
 (0)