pandas.BooleanDtype#
- class pandas.BooleanDtype[source]#
Extension dtype for boolean data.
This is a pandas Extension dtype for boolean data with support for missing values. BooleanDtype is the dtype companion to
BooleanArray, which implements Kleene logic (sometimes called three-value logic) for logical operations. See Kleene logical operations for more.See also
arrays.BooleanArrayArray of boolean (True/False) data with missing values.
Int64DtypeExtension dtype for int64 integer data.
StringDtypeExtension dtype for string data.
Examples
>>> pd.BooleanDtype() BooleanDtype
>>> pd.array([True, False, None], dtype=pd.BooleanDtype()) <BooleanArray> [True, False, <NA>] Length: 3, dtype: boolean
>>> pd.array([True, False, None], dtype="boolean") <BooleanArray> [True, False, <NA>] Length: 3, dtype: boolean