pyarrow.bool8#

pyarrow.bool8()#

Create instance of bool8 extension type.

Returns:
typeBool8Type

Examples

Create an instance of bool8 extension type:

>>> import pyarrow as pa
>>> type = pa.bool8()
>>> type
Bool8Type(extension<arrow.bool8>)

Inspect the data type:

>>> type.storage_type
DataType(int8)

Create a table with a bool8 array:

>>> arr = [-1, 0, 1, 2, None]
>>> storage = pa.array(arr, pa.int8())
>>> other = pa.ExtensionArray.from_storage(type, storage)
>>> pa.table([other], names=["unknown_col"])
pyarrow.Table
unknown_col: extension<arrow.bool8>
----
unknown_col: [[-1,0,1,2,null]]