From 6ddc7435d27ba62e705ea29e1fb8ee2d3470abc7 Mon Sep 17 00:00:00 2001 From: Yi-Han Chen Date: Tue, 13 Aug 2024 20:12:15 -0700 Subject: [PATCH 1/2] docs: FIx ES01, SA01 code check of `pandas.api.types.is_bool_dtype` --- ci/code_checks.sh | 1 - pandas/core/dtypes/common.py | 8 ++++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/ci/code_checks.sh b/ci/code_checks.sh index eb4f03cdf4083..0c3b6014cb30a 100755 --- a/ci/code_checks.sh +++ b/ci/code_checks.sh @@ -239,7 +239,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then -i "pandas.api.extensions.ExtensionArray.view SA01" \ -i "pandas.api.interchange.from_dataframe RT03,SA01" \ -i "pandas.api.types.is_bool PR01,SA01" \ - -i "pandas.api.types.is_bool_dtype SA01" \ -i "pandas.api.types.is_categorical_dtype SA01" \ -i "pandas.api.types.is_complex PR01,SA01" \ -i "pandas.api.types.is_complex_dtype SA01" \ diff --git a/pandas/core/dtypes/common.py b/pandas/core/dtypes/common.py index 64b5278424192..e6ea1af73a409 100644 --- a/pandas/core/dtypes/common.py +++ b/pandas/core/dtypes/common.py @@ -1274,6 +1274,10 @@ def is_bool_dtype(arr_or_dtype) -> bool: """ Check whether the provided array or dtype is of a boolean dtype. + This function verifies whether a given object is a boolean data type. The input + can be an array or a dtype object. Accepted array types include instances + of ``np.array``, ``pd.Series``, ``pd.Index``, and similar array-like structures. + Parameters ---------- arr_or_dtype : array-like or dtype @@ -1284,6 +1288,10 @@ def is_bool_dtype(arr_or_dtype) -> bool: boolean Whether or not the array or dtype is of a boolean dtype. + See Also + -------- + pandas.api.types.is_bool : Check if an object is a boolean. + Notes ----- An ExtensionArray is considered boolean when the ``_is_boolean`` From 2b0d6a97b94ad326facc5645d4fd310c73b8f705 Mon Sep 17 00:00:00 2001 From: Yi-Han Chen Date: Tue, 13 Aug 2024 20:46:17 -0700 Subject: [PATCH 2/2] chore: Remove pandas in See Also --- pandas/core/dtypes/common.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/core/dtypes/common.py b/pandas/core/dtypes/common.py index e6ea1af73a409..bcf1ade9b0320 100644 --- a/pandas/core/dtypes/common.py +++ b/pandas/core/dtypes/common.py @@ -1290,7 +1290,7 @@ def is_bool_dtype(arr_or_dtype) -> bool: See Also -------- - pandas.api.types.is_bool : Check if an object is a boolean. + api.types.is_bool : Check if an object is a boolean. Notes -----