Skip to content

Commit

Permalink
DOC: Adding example to head and tail method (pandas-dev#16416)
Browse files Browse the repository at this point in the history
  • Loading branch information
Cheukting committed Dec 13, 2017
1 parent a9f5ad9 commit f6363ca
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions pandas/core/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -3563,7 +3563,7 @@ def head(self, n=5):
-------
obj_head : type of caller
The first n rows of the caller object.
Examples
--------
>>> df = pd.DataFrame({'animal':['falcon', 'parrot', 'lion',
Expand All @@ -3577,7 +3577,7 @@ def head(self, n=5):
4 shark
5 bee
6 bear
Viewing the last 5 lines (the default)
>>> df.head()
animal
Expand All @@ -3586,7 +3586,7 @@ def head(self, n=5):
2 lion
3 monkey
4 shark
Viewing the last n lines (three in this case)
>>> df.head(3)
animal
Expand All @@ -3610,7 +3610,7 @@ def tail(self, n=5):
-------
obj_tail : type of caller
The last n rows of the caller object.
Examples
--------
>>> df = pd.DataFrame({'animal':['falcon', 'parrot', 'lion',
Expand All @@ -3624,23 +3624,23 @@ def tail(self, n=5):
4 shark
5 bee
6 bear
Viewing the last 5 lines (the default)
>>> df.tail()
Viewing the last 5 lines (the default)
>>> df.tail()
animal
2 lion
3 monkey
4 shark
5 bee
6 bear
Viewing the last n lines (three in this case)
>>> df.tail(3)
Viewing the last n lines (three in this case)
>>> df.tail(3)
animal
4 shark
5 bee
6 bear
"""

if n == 0:
Expand Down

0 comments on commit f6363ca

Please sign in to comment.