From 6a1b00d7b1f047ce438890551f1362ba14f774bd Mon Sep 17 00:00:00 2001 From: John Doe Date: Mon, 4 Aug 2025 14:35:57 -0700 Subject: [PATCH 1/2] modified booleanDType docstring --- pandas/core/arrays/boolean.py | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/pandas/core/arrays/boolean.py b/pandas/core/arrays/boolean.py index 87c18fe346c62..2e26c843064a7 100644 --- a/pandas/core/arrays/boolean.py +++ b/pandas/core/arrays/boolean.py @@ -41,27 +41,45 @@ @register_extension_dtype class BooleanDtype(BaseMaskedDtype): """ - Extension dtype for boolean data. + Extend Boolean data type. + + `BooleanDtype` enables use of nullable boolean data in pandas + structures such as`Series`. 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. - + Attributes ---------- None 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 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 """ From 54d805fb5a506a8b846c37cca1790fb9d4a8b352 Mon Sep 17 00:00:00 2001 From: John Doe Date: Mon, 4 Aug 2025 14:49:09 -0700 Subject: [PATCH 2/2] modified 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 2e26c843064a7..7cc5eb0c6dd12 100644 --- a/pandas/core/arrays/boolean.py +++ b/pandas/core/arrays/boolean.py @@ -43,8 +43,8 @@ class BooleanDtype(BaseMaskedDtype): """ Extend Boolean data type. - `BooleanDtype` enables use of nullable boolean data in pandas - structures such as`Series`. Internally, it is backed by pandas BooleanArray, + `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`)