From f6363ca9506195d176ec1a8d462d1b4d9c9eddde Mon Sep 17 00:00:00 2001 From: Cheuk Ho Date: Wed, 13 Dec 2017 08:13:32 +0000 Subject: [PATCH] DOC: Adding example to head and tail method (#16416) --- pandas/core/generic.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/pandas/core/generic.py b/pandas/core/generic.py index 8364f8937adc00..b071d75aea6741 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -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', @@ -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 @@ -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 @@ -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', @@ -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: