From 1b0058d1328d9177050981b034feff5788b4cd1a Mon Sep 17 00:00:00 2001 From: Samuel Date: Mon, 6 May 2024 10:52:56 +0100 Subject: [PATCH 1/2] Minor fix to docstring formatting Fix minor inconsistency in docstring formatting for `head()` and `tail()`. Fix the code formatting for the `n` variable appearing in the docstrings of `head()` and `tail()` so that it is consistent with surrounding uses of the variable. --- 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 20d8bd3bda21f..b78551ef41dab 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -5527,7 +5527,7 @@ def head(self, n: int = 5) -> Self: it returns an empty object. When ``n`` is negative, it returns all rows except the last ``|n|`` rows, mirroring the behavior of ``df[:n]``. - If n is larger than the number of rows, this function returns all rows. + If ``n`` is larger than the number of rows, this function returns all rows. Parameters ---------- @@ -5615,7 +5615,7 @@ def tail(self, n: int = 5) -> Self: 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. + If `n` is larger than the number of rows, this function returns all rows. Parameters ---------- From 40df784de54193cf6decb56f6bd988234581e769 Mon Sep 17 00:00:00 2001 From: Matthew Roeschke <10647082+mroeschke@users.noreply.github.com> Date: Mon, 6 May 2024 10:00:41 -0700 Subject: [PATCH 2/2] Update pandas/core/generic.py --- pandas/core/generic.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/core/generic.py b/pandas/core/generic.py index b78551ef41dab..2a36f5fb478b4 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -5615,7 +5615,7 @@ def tail(self, n: int = 5) -> Self: 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. + If ``n`` is larger than the number of rows, this function returns all rows. Parameters ----------