pyarrow.nulls

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

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

Parameters
  • size (int) – Array length.

  • type (pyarrow.DataType, default None) – Explicit type for the array. By default use NullType.

  • memory_pool (MemoryPool, default None) – Arrow MemoryPool to use for allocations. Uses the default memory pool is not passed.

Returns

arr (Array)

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
]