diff --git a/pandas/core/arrays/boolean.py b/pandas/core/arrays/boolean.py index 87c18fe346c62..8531a634875e7 100644 --- a/pandas/core/arrays/boolean.py +++ b/pandas/core/arrays/boolean.py @@ -41,11 +41,16 @@ @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 + BooleanArray is considered experimental. The implementation and parts of the API may change without warning. Attributes @@ -54,14 +59,27 @@ 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 """