diff --git a/pandas/core/generic.py b/pandas/core/generic.py index d5b55a89f28df..ebb853c00872b 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -5182,7 +5182,7 @@ def head(self: NDFrameT, n: int = 5) -> NDFrameT: has the right type of data in it. For negative values of `n`, this function returns all rows except - the last `n` rows, equivalent to ``df[:-n]``. + the last `|n|` rows, equivalent to ``df[:n]``. If n is larger than the number of rows, this function returns all rows. @@ -5257,7 +5257,7 @@ def tail(self: NDFrameT, n: int = 5) -> NDFrameT: after sorting or appending rows. For negative values of `n`, this function returns all rows except - the first `n` rows, equivalent to ``df[n:]``. + the first `|n|` rows, equivalent to ``df[|n|:]``. If n is larger than the number of rows, this function returns all rows.