From f19859d78e927beb1e7c3eeca4488c6b657aaf96 Mon Sep 17 00:00:00 2001 From: Yashpal Ahlawat Date: Sat, 30 Mar 2024 00:21:57 +0530 Subject: [PATCH 1/3] pandas.DataFrame.where method fixed for docstring validations --- ci/code_checks.sh | 1 - pandas/core/generic.py | 6 ++++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/ci/code_checks.sh b/ci/code_checks.sh index 0c4e6641444f1..7d3c7ad3d8542 100755 --- a/ci/code_checks.sh +++ b/ci/code_checks.sh @@ -131,7 +131,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then -i "pandas.DataFrame.unstack RT03" \ -i "pandas.DataFrame.value_counts RT03" \ -i "pandas.DataFrame.var PR01,RT03,SA01" \ - -i "pandas.DataFrame.where RT03" \ -i "pandas.DatetimeIndex.ceil SA01" \ -i "pandas.DatetimeIndex.date SA01" \ -i "pandas.DatetimeIndex.day SA01" \ diff --git a/pandas/core/generic.py b/pandas/core/generic.py index 858d2ba82a969..62885d809a411 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -9807,8 +9807,10 @@ def where( Returns ------- - Series or DataFrame unless ``inplace=True`` in which case - returns None. + Series or Database or None + When applied to a Series, the function will return a Series, + and when applied to a DataFrame, it will return a DataFrame; + if ``inplace=True``, it will return None. See Also -------- From f9cb58397b54a7a94ec686779f57c9ee806535e4 Mon Sep 17 00:00:00 2001 From: Yashpal Ahlawat Date: Sat, 30 Mar 2024 12:28:10 +0530 Subject: [PATCH 2/3] Removed additional functions fixed by change --- ci/code_checks.sh | 3 --- 1 file changed, 3 deletions(-) diff --git a/ci/code_checks.sh b/ci/code_checks.sh index 7d3c7ad3d8542..3521c44eda312 100755 --- a/ci/code_checks.sh +++ b/ci/code_checks.sh @@ -99,7 +99,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then -i "pandas.DataFrame.kurt RT03,SA01" \ -i "pandas.DataFrame.kurtosis RT03,SA01" \ -i "pandas.DataFrame.last_valid_index SA01" \ - -i "pandas.DataFrame.mask RT03" \ -i "pandas.DataFrame.max RT03" \ -i "pandas.DataFrame.mean RT03,SA01" \ -i "pandas.DataFrame.median RT03,SA01" \ @@ -399,7 +398,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then -i "pandas.Series.list.flatten SA01" \ -i "pandas.Series.list.len SA01" \ -i "pandas.Series.lt PR07,SA01" \ - -i "pandas.Series.mask RT03" \ -i "pandas.Series.max RT03" \ -i "pandas.Series.mean RT03,SA01" \ -i "pandas.Series.median RT03,SA01" \ @@ -486,7 +484,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then -i "pandas.Series.update PR07,SA01" \ -i "pandas.Series.value_counts RT03" \ -i "pandas.Series.var PR01,RT03,SA01" \ - -i "pandas.Series.where RT03" \ -i "pandas.SparseDtype SA01" \ -i "pandas.Timedelta PR07,SA01" \ -i "pandas.Timedelta.as_unit SA01" \ From d31ca332e13e3564a8e16eef04355bb4a8c9e146 Mon Sep 17 00:00:00 2001 From: Yashpal Ahlawat Date: Mon, 1 Apr 2024 10:00:57 +0530 Subject: [PATCH 3/3] Removed typo --- 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 62885d809a411..862c6756ebb28 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -9807,7 +9807,7 @@ def where( Returns ------- - Series or Database or None + Series or DataFrame or None When applied to a Series, the function will return a Series, and when applied to a DataFrame, it will return a DataFrame; if ``inplace=True``, it will return None.