Skip to content

Commit 42202f6

Browse files
committed
DOC: Enhance BooleanDtype docstring with details on missing values and examples
1 parent 9f4c0ba commit 42202f6

File tree

1 file changed

+27
-6
lines changed

1 file changed

+27
-6
lines changed

pandas/core/arrays/boolean.py

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,19 @@ class BooleanDtype(BaseMaskedDtype):
4545
"""
4646
Extension dtype for boolean data.
4747
48+
This is a pandas Extension dtype for boolean data with support for
49+
missing values. BooleanDtype is the dtype companion to :class:`BooleanArray`,
50+
which implements Kleene logic (sometimes called three-value logic) for
51+
logical operations. See :ref:`boolean.kleene` for more.
52+
4853
.. warning::
4954
50-
BooleanDtype is considered experimental. The implementation and
51-
parts of the API may change without warning.
55+
BooleanDtype is considered experimental. The implementation and
56+
parts of the API may change without warning.
57+
58+
Parameters
59+
----------
60+
None
5261
5362
Attributes
5463
----------
@@ -58,14 +67,26 @@ class BooleanDtype(BaseMaskedDtype):
5867
-------
5968
None
6069
61-
See Also
62-
--------
63-
StringDtype : Extension dtype for string data.
64-
6570
Examples
6671
--------
6772
>>> pd.BooleanDtype()
6873
BooleanDtype
74+
75+
>>> pd.array([True, False, None], dtype=pd.BooleanDtype())
76+
<BooleanArray>
77+
[True, False, <NA>]
78+
Length: 3, dtype: boolean
79+
80+
>>> pd.array([True, False, None], dtype="boolean")
81+
<BooleanArray>
82+
[True, False, <NA>]
83+
Length: 3, dtype: boolean
84+
85+
See Also
86+
--------
87+
BooleanArray : Array of boolean (True/False) data with missing values.
88+
Int64Dtype : Extension dtype for int64 integer data.
89+
StringDtype : Extension dtype for string data.
6990
"""
7091

7192
name: ClassVar[str] = "boolean"

0 commit comments

Comments
 (0)