From 3b8ee3afc39fe2eafa56f67c6b8c9f5166b8bb37 Mon Sep 17 00:00:00 2001 From: StephenLHChan Date: Fri, 26 Jan 2024 20:46:25 -0500 Subject: [PATCH 1/2] DOCS: DataFrame.any() and DataFrame.all() documentation specifies the wrong return types --- pandas/core/generic.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pandas/core/generic.py b/pandas/core/generic.py index 91a4271509421..4103313211228 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -13081,8 +13081,8 @@ def last_valid_index(self) -> Hashable | None: Returns ------- {name1} or {name2} - If level is specified, then, {name2} is returned; otherwise, {name1} - is returned. + If axis=None, then a {name2} boolean is returned. Otherwise a Series is + returned with index matching the index argument. {see_also} {examples}""" @@ -13643,12 +13643,16 @@ def make_doc(name: str, ndim: int) -> str: axis_descr = "{index (0), columns (1)}" if name == "any": + name1 = "DataFrame" + name2 = "scalar" base_doc = _bool_doc desc = _any_desc see_also = _any_see_also examples = _any_examples kwargs = {"empty_value": "False"} elif name == "all": + name1 = "DataFrame" + name2 = "scalar" base_doc = _bool_doc desc = _all_desc see_also = _all_see_also From a3ceab2a12255cab8a762c85b8a1553c1443f843 Mon Sep 17 00:00:00 2001 From: StephenLHChan Date: Fri, 26 Jan 2024 22:01:47 -0500 Subject: [PATCH 2/2] fix: lint --- 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 4103313211228..d64404c0f3924 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -13081,7 +13081,7 @@ def last_valid_index(self) -> Hashable | None: Returns ------- {name1} or {name2} - If axis=None, then a {name2} boolean is returned. Otherwise a Series is + If axis=None, then a {name2} boolean is returned. Otherwise a Series is returned with index matching the index argument. {see_also}