File tree Expand file tree Collapse file tree 1 file changed +23
-4
lines changed Expand file tree Collapse file tree 1 file changed +23
-4
lines changed Original file line number Diff line number Diff line change 41
41
@register_extension_dtype
42
42
class BooleanDtype (BaseMaskedDtype ):
43
43
"""
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`)
45
50
46
51
.. warning::
47
52
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.
50
55
51
56
Attributes
52
57
----------
53
58
None
54
59
55
60
Methods
56
61
-------
57
- None
62
+ __from_arrow__(array)
63
+ Construct BooleanArray from pyarrow Array/ChunkedArray.
58
64
59
65
See Also
60
66
--------
61
67
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.
62
70
63
71
Examples
64
72
--------
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
+
65
83
>>> pd.BooleanDtype()
66
84
BooleanDtype
67
85
"""
68
86
87
+
69
88
name : ClassVar [str ] = "boolean"
70
89
71
90
# The value used to fill '_data' to avoid upcasting
You can’t perform that action at this time.
0 commit comments