From e4e593ee48b5c6427af740b21740925f0be27f26 Mon Sep 17 00:00:00 2001 From: INDIG0N Date: Mon, 21 Mar 2022 23:33:01 -0400 Subject: [PATCH 1/2] updated head and tail docstrings --- pandas/core/generic.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pandas/core/generic.py b/pandas/core/generic.py index 8bfd9f3cd962d..4a4e5b7f42ea2 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -5284,6 +5284,8 @@ def head(self: NDFrameT, n: int = 5) -> NDFrameT: For negative values of `n`, this function returns all rows except the last `n` rows, equivalent to ``df[:-n]``. + If n is larger than the number of rows, this function returns al rows. + Parameters ---------- n : int, default 5 @@ -5357,6 +5359,8 @@ def tail(self: NDFrameT, n: int = 5) -> NDFrameT: For negative values of `n`, this function returns all rows except the first `n` rows, equivalent to ``df[n:]``. + If n is larger than the number of rows, this function returns al rows. + Parameters ---------- n : int, default 5 From bacad2c36319614450043eeb96e9c3352e8a7ede Mon Sep 17 00:00:00 2001 From: INDIG0N Date: Tue, 22 Mar 2022 14:31:56 -0400 Subject: [PATCH 2/2] fixed typos --- pandas/core/generic.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pandas/core/generic.py b/pandas/core/generic.py index 4a4e5b7f42ea2..98e0ab43f2a09 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -5284,7 +5284,7 @@ def head(self: NDFrameT, n: int = 5) -> NDFrameT: For negative values of `n`, this function returns all rows except the last `n` rows, equivalent to ``df[:-n]``. - If n is larger than the number of rows, this function returns al rows. + If n is larger than the number of rows, this function returns all rows. Parameters ---------- @@ -5359,7 +5359,7 @@ def tail(self: NDFrameT, n: int = 5) -> NDFrameT: For negative values of `n`, this function returns all rows except the first `n` rows, equivalent to ``df[n:]``. - If n is larger than the number of rows, this function returns al rows. + If n is larger than the number of rows, this function returns all rows. Parameters ----------