Skip to content

Commit 486d40c

Browse files
committed
updated BooleanDType docstring
1 parent 2ad2abd commit 486d40c

File tree

1 file changed

+23
-4
lines changed

1 file changed

+23
-4
lines changed

pandas/core/arrays/boolean.py

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,31 +41,50 @@
4141
@register_extension_dtype
4242
class BooleanDtype(BaseMaskedDtype):
4343
"""
44-
Extension dtype for boolean data.
44+
Extend Boolean data type.
45+
46+
`BooleanDtype` enables use of null boolean data in pandas structures such as
47+
`Series` and `array`. Internally, it is backed by pandas BooleanArray,
48+
which stores data using two numpy boolean arrays: one to store values('True'/'False')
49+
and a mask to indicate missing values (`pd.NA`)
4550
4651
.. warning::
4752
48-
BooleanDtype is considered experimental. The implementation and
49-
parts of the API may change without warning.
53+
BooleanDtype is considered experimental. The implementation and
54+
parts of the API may change without warning.
5055
5156
Attributes
5257
----------
5358
None
5459
5560
Methods
5661
-------
57-
None
62+
__from_arrow__(array)
63+
Construct BooleanArray from pyarrow Array/ChunkedArray.
5864
5965
See Also
6066
--------
6167
StringDtype : Extension dtype for string data.
68+
BooleanArray: Array of boolean (True/False) data with missing values.
69+
BaseMaskedDType: Base class for dtypes for the BaseMaskedArray subclasses.
6270
6371
Examples
6472
--------
73+
Creating a Boolean series with missing values:
74+
75+
>>> pd.Series([True, False, pd.NA], dtype="boolean")
76+
0 True
77+
1 False
78+
2 <NA>
79+
dtype: boolean
80+
81+
Constructing a BooleanDType directly:
82+
6583
>>> pd.BooleanDtype()
6684
BooleanDtype
6785
"""
6886

87+
6988
name: ClassVar[str] = "boolean"
7089

7190
# The value used to fill '_data' to avoid upcasting

0 commit comments

Comments
 (0)