Skip to content

DOC: updated BooleanDType docstring #62045

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 21 additions & 3 deletions pandas/core/arrays/boolean.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 <NA>
dtype: boolean

Constructing a BooleanDtype directly:

>>> pd.BooleanDtype()
BooleanDtype
"""
Expand Down
Loading