pyarrow.nulls

pyarrow.nulls(size, type=None, MemoryPool memory_pool=None)

Create a strongly-typed Array instance with all elements null.

Parameters
sizeint

Array length.

typepyarrow.DataType, default None

Explicit type for the array. By default use NullType.

memory_poolMemoryPool, default None

Arrow MemoryPool to use for allocations. Uses the default memory pool is not passed.

Returns
arrArray

Examples

>>> import pyarrow as pa
>>> pa.nulls(10)
<pyarrow.lib.NullArray object at 0x7ffaf04c2e50>
10 nulls
>>> pa.nulls(3, pa.uint32())
<pyarrow.lib.UInt32Array object at 0x7ffaf04c2e50>
[
  null,
  null,
  null
]