From 486d40c6f98a2b71edbcdc61f579cc68217472c8 Mon Sep 17 00:00:00 2001 From: John Doe Date: Mon, 4 Aug 2025 15:44:15 -0700 Subject: [PATCH 1/4] updated BooleanDType docstring --- pandas/core/arrays/boolean.py | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/pandas/core/arrays/boolean.py b/pandas/core/arrays/boolean.py index 87c18fe346c62..4ffe1b80a90f7 100644 --- a/pandas/core/arrays/boolean.py +++ b/pandas/core/arrays/boolean.py @@ -41,12 +41,17 @@ @register_extension_dtype class BooleanDtype(BaseMaskedDtype): """ - Extension dtype for boolean data. + Extend Boolean data type. + + `BooleanDtype` enables use of null boolean data in pandas structures such as + `Series` and `array`. Internally, it is backed by pandas BooleanArray, + which stores data using two numpy boolean arrays: one to store values('True'/'False') + and a mask to indicate missing values (`pd.NA`) .. 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. Attributes ---------- @@ -54,18 +59,32 @@ class BooleanDtype(BaseMaskedDtype): Methods ------- - None + __from_arrow__(array) + Construct BooleanArray from pyarrow Array/ChunkedArray. See Also -------- StringDtype : Extension dtype for string data. + BooleanArray: Array of boolean (True/False) data with missing values. + BaseMaskedDType: Base class for dtypes for the BaseMaskedArray subclasses. Examples -------- + Creating a Boolean series with missing values: + + >>> pd.Series([True, False, pd.NA], dtype="boolean") + 0 True + 1 False + 2 + dtype: boolean + + Constructing a BooleanDType directly: + >>> pd.BooleanDtype() BooleanDtype """ + name: ClassVar[str] = "boolean" # The value used to fill '_data' to avoid upcasting From bdd81081e28e98f1a05da1684cedddbb6f974986 Mon Sep 17 00:00:00 2001 From: John Doe Date: Mon, 4 Aug 2025 17:51:35 -0700 Subject: [PATCH 2/4] Updated BooleanDTyepe docstring --- pandas/core/arrays/boolean.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pandas/core/arrays/boolean.py b/pandas/core/arrays/boolean.py index 4ffe1b80a90f7..8b2ed947b9ed7 100644 --- a/pandas/core/arrays/boolean.py +++ b/pandas/core/arrays/boolean.py @@ -45,8 +45,8 @@ class BooleanDtype(BaseMaskedDtype): `BooleanDtype` enables use of null boolean data in pandas structures such as `Series` and `array`. Internally, it is backed by pandas BooleanArray, - which stores data using two numpy boolean arrays: one to store values('True'/'False') - and a mask to indicate missing values (`pd.NA`) + which stores data using two numpy boolean arrays: one to store values + ('True'/'False') and a mask to indicate missing values (`pd.NA`) .. warning:: @@ -84,7 +84,6 @@ class BooleanDtype(BaseMaskedDtype): BooleanDtype """ - name: ClassVar[str] = "boolean" # The value used to fill '_data' to avoid upcasting From a9a22b06e84ceb17ed00097f6e8b685bc62edb2d Mon Sep 17 00:00:00 2001 From: John Doe Date: Mon, 4 Aug 2025 18:17:43 -0700 Subject: [PATCH 3/4] Updated BooleanDType docstring --- pandas/core/arrays/boolean.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pandas/core/arrays/boolean.py b/pandas/core/arrays/boolean.py index 8b2ed947b9ed7..5729aa6fffaee 100644 --- a/pandas/core/arrays/boolean.py +++ b/pandas/core/arrays/boolean.py @@ -50,8 +50,8 @@ class BooleanDtype(BaseMaskedDtype): .. warning:: - BooleanDtype is considered experimental. The implementation and - parts of the API may change without warning. + BooleanArray is considered experimental. The implementation and + parts of the API may change without warning. Attributes ---------- From be162387c6fade9fa2eddb94766a93fab7a8f0c1 Mon Sep 17 00:00:00 2001 From: John Doe Date: Mon, 4 Aug 2025 21:51:08 -0700 Subject: [PATCH 4/4] changed BooleanDType to BooleanDtype --- pandas/core/arrays/boolean.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pandas/core/arrays/boolean.py b/pandas/core/arrays/boolean.py index 5729aa6fffaee..8531a634875e7 100644 --- a/pandas/core/arrays/boolean.py +++ b/pandas/core/arrays/boolean.py @@ -66,7 +66,7 @@ class BooleanDtype(BaseMaskedDtype): -------- StringDtype : Extension dtype for string data. BooleanArray: Array of boolean (True/False) data with missing values. - BaseMaskedDType: Base class for dtypes for the BaseMaskedArray subclasses. + BaseMaskedDtype: Base class for dtypes for the BaseMaskedArray subclasses. Examples -------- @@ -78,7 +78,7 @@ class BooleanDtype(BaseMaskedDtype): 2 dtype: boolean - Constructing a BooleanDType directly: + Constructing a BooleanDtype directly: >>> pd.BooleanDtype() BooleanDtype