From 3d43c57cddf8274fe073169cf0dc6eeeac1f8df6 Mon Sep 17 00:00:00 2001 From: "jennifer.weiss" Date: Sat, 10 Mar 2018 13:43:08 -0600 Subject: [PATCH 1/2] DOC: Update pandas.DataFrame.tail docstring -Add extended summary --- pandas/core/generic.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pandas/core/generic.py b/pandas/core/generic.py index d5bdeb7fe1a4d..49d9e656e783e 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -3660,7 +3660,11 @@ def head(self, n=5): def tail(self, n=5): """ - Return the last n rows. + Return the last `n` rows. + + This function returns last `n` rows from the object based on the + underlying index. It is useful for quickly verifying data, + for example, after sorting or appending rows. Parameters ---------- From 62717f52ec7aa2c3d951dbb384ce3d768dc7dcb2 Mon Sep 17 00:00:00 2001 From: "jennifer.weiss" Date: Sat, 10 Mar 2018 17:16:24 -0600 Subject: [PATCH 2/2] Update wording to be correct --- pandas/core/generic.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pandas/core/generic.py b/pandas/core/generic.py index 49d9e656e783e..a6b7a3d6cd02a 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -3662,9 +3662,9 @@ def tail(self, n=5): """ Return the last `n` rows. - This function returns last `n` rows from the object based on the - underlying index. It is useful for quickly verifying data, - for example, after sorting or appending rows. + This function returns last `n` rows from the object based on + position. It is useful for quickly verifying data, for example, + after sorting or appending rows. Parameters ---------- @@ -3706,7 +3706,7 @@ def tail(self, n=5): 7 whale 8 zebra - Viewing the last n lines (three in this case) + Viewing the last `n` lines (three in this case) >>> df.tail(3) animal