diff --git a/pandas/core/generic.py b/pandas/core/generic.py index 8bfd9f3cd962d..98e0ab43f2a09 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 all 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 all rows. + Parameters ---------- n : int, default 5