From 42202f63f68a91338b07e6e0461414f53b321189 Mon Sep 17 00:00:00 2001 From: Lobna Allam Date: Tue, 28 Oct 2025 02:07:19 +0000 Subject: [PATCH 1/6] DOC: Enhance BooleanDtype docstring with details on missing values and examples --- pandas/core/arrays/boolean.py | 33 +++++++++++++++++++++++++++------ 1 file changed, 27 insertions(+), 6 deletions(-) diff --git a/pandas/core/arrays/boolean.py b/pandas/core/arrays/boolean.py index aa28e846413f0..e1877271075da 100644 --- a/pandas/core/arrays/boolean.py +++ b/pandas/core/arrays/boolean.py @@ -45,10 +45,19 @@ class BooleanDtype(BaseMaskedDtype): """ Extension dtype for boolean data. + This is a pandas Extension dtype for boolean data with support for + missing values. BooleanDtype is the dtype companion to :class:`BooleanArray`, + which implements Kleene logic (sometimes called three-value logic) for + logical operations. See :ref:`boolean.kleene` for more. + .. warning:: - BooleanDtype is considered experimental. The implementation and - parts of the API may change without warning. + BooleanDtype is considered experimental. The implementation and + parts of the API may change without warning. + + Parameters + ---------- + None Attributes ---------- @@ -58,14 +67,26 @@ class BooleanDtype(BaseMaskedDtype): ------- None - See Also - -------- - StringDtype : Extension dtype for string data. - Examples -------- >>> pd.BooleanDtype() BooleanDtype + + >>> pd.array([True, False, None], dtype=pd.BooleanDtype()) + + [True, False, ] + Length: 3, dtype: boolean + + >>> pd.array([True, False, None], dtype="boolean") + + [True, False, ] + Length: 3, dtype: boolean + + See Also + -------- + BooleanArray : Array of boolean (True/False) data with missing values. + Int64Dtype : Extension dtype for int64 integer data. + StringDtype : Extension dtype for string data. """ name: ClassVar[str] = "boolean" From da1ec73c76317bda4e9f8419f6bd1c1347088232 Mon Sep 17 00:00:00 2001 From: Lobna Allam Date: Thu, 30 Oct 2025 13:39:03 +0000 Subject: [PATCH 2/6] DOC: Update BooleanDtype documentation to clarify experimental status --- pandas/core/arrays/boolean.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/pandas/core/arrays/boolean.py b/pandas/core/arrays/boolean.py index e1877271075da..a3335483e201f 100644 --- a/pandas/core/arrays/boolean.py +++ b/pandas/core/arrays/boolean.py @@ -52,12 +52,8 @@ class BooleanDtype(BaseMaskedDtype): .. warning:: - BooleanDtype is considered experimental. The implementation and - parts of the API may change without warning. - - Parameters - ---------- - None + BooleanDtype is considered experimental. The implementation and + parts of the API may change without warning. Attributes ---------- From e713596777b0550182410a2f92dc15249e82921d Mon Sep 17 00:00:00 2001 From: Lobna Allam Date: Thu, 30 Oct 2025 14:14:30 +0000 Subject: [PATCH 3/6] docstring formatting --- pandas/core/arrays/boolean.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/pandas/core/arrays/boolean.py b/pandas/core/arrays/boolean.py index a3335483e201f..e8990d1a77a8a 100644 --- a/pandas/core/arrays/boolean.py +++ b/pandas/core/arrays/boolean.py @@ -63,6 +63,12 @@ class BooleanDtype(BaseMaskedDtype): ------- None + See Also + -------- + BooleanArray : Array of boolean (True/False) data with missing values. + Int64Dtype : Extension dtype for int64 integer data. + StringDtype : Extension dtype for string data. + Examples -------- >>> pd.BooleanDtype() @@ -78,11 +84,6 @@ class BooleanDtype(BaseMaskedDtype): [True, False, ] Length: 3, dtype: boolean - See Also - -------- - BooleanArray : Array of boolean (True/False) data with missing values. - Int64Dtype : Extension dtype for int64 integer data. - StringDtype : Extension dtype for string data. """ name: ClassVar[str] = "boolean" From 0b1c15fcf0c16483f1f1e21ca0d893d9ea090a29 Mon Sep 17 00:00:00 2001 From: Lobna Allam Date: Thu, 30 Oct 2025 14:48:34 +0000 Subject: [PATCH 4/6] docstring formatting --- pandas/core/arrays/boolean.py | 1 - 1 file changed, 1 deletion(-) diff --git a/pandas/core/arrays/boolean.py b/pandas/core/arrays/boolean.py index e8990d1a77a8a..43757d6bd0bae 100644 --- a/pandas/core/arrays/boolean.py +++ b/pandas/core/arrays/boolean.py @@ -83,7 +83,6 @@ class BooleanDtype(BaseMaskedDtype): [True, False, ] Length: 3, dtype: boolean - """ name: ClassVar[str] = "boolean" From f9c22fafc986f9fa7a2d129b7e6382277878e1d9 Mon Sep 17 00:00:00 2001 From: Lobna Allam Date: Sun, 2 Nov 2025 10:06:21 -0500 Subject: [PATCH 5/6] Update pandas/core/arrays/boolean.py Co-authored-by: Richard Shadrach <45562402+rhshadrach@users.noreply.github.com> --- pandas/core/arrays/boolean.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/core/arrays/boolean.py b/pandas/core/arrays/boolean.py index 43757d6bd0bae..57abd5cf89020 100644 --- a/pandas/core/arrays/boolean.py +++ b/pandas/core/arrays/boolean.py @@ -46,7 +46,7 @@ class BooleanDtype(BaseMaskedDtype): Extension dtype for boolean data. This is a pandas Extension dtype for boolean data with support for - missing values. BooleanDtype is the dtype companion to :class:`BooleanArray`, + missing values. BooleanDtype is the dtype companion to :class:`.BooleanArray`, which implements Kleene logic (sometimes called three-value logic) for logical operations. See :ref:`boolean.kleene` for more. From 4c51060b01a53e6aa4188c30c4bb201cad3d5c48 Mon Sep 17 00:00:00 2001 From: Lobna Allam Date: Sun, 2 Nov 2025 10:06:28 -0500 Subject: [PATCH 6/6] Update pandas/core/arrays/boolean.py Co-authored-by: Richard Shadrach <45562402+rhshadrach@users.noreply.github.com> --- pandas/core/arrays/boolean.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/core/arrays/boolean.py b/pandas/core/arrays/boolean.py index 57abd5cf89020..2d7bae7833f29 100644 --- a/pandas/core/arrays/boolean.py +++ b/pandas/core/arrays/boolean.py @@ -65,7 +65,7 @@ class BooleanDtype(BaseMaskedDtype): See Also -------- - BooleanArray : Array of boolean (True/False) data with missing values. + arrays.BooleanArray : Array of boolean (True/False) data with missing values. Int64Dtype : Extension dtype for int64 integer data. StringDtype : Extension dtype for string data.