Array
Base class for all Arrow array types.array()
Create a pyarrow.Array instance from a Python object.If both type and size are specified may be a single use iterable. If not strongly-typed, Arrow type will be inferred for resulting array. Any Arrow-compatible array that implements the Arrow PyCapsule Protocol can be passed as well.
Explicit type to attempt to coerce to, otherwise will be inferred from the data.
Indicate which values are null (True) or not null (False).
Size of the elements. If the input is larger than size bail at this length.
Use pandas’s semantics for inferring nulls from values in ndarray-like data. Defaults to False if not passed explicitly, or True if a pandas object is passed in.
Check for overflows or other unsafe conversions.
If not passed, will allocate memory from the currently-set default memory pool.
A ChunkedArray instead of an Array is returned if the object data overflowed binary storage or the object’s
__arrow_array__ protocol method returned a chunked array.Properties
type
Return the data type of the array.The Arrow data type of this array.
null_count
Return the number of null values in the array.The count of null values.
Methods
slice()
Compute zero-copy slice of this array.Offset from start of array to slice.
Length of slice (default is until end of array from offset).
A zero-copy slice of the array.
cast()
Cast array values to another data type.Type to cast to.
Check for overflows or other unsafe conversions.
Array with values cast to the target type.
to_pylist()
Convert to a Python list.A Python list with the array values.
to_numpy()
Convert to a NumPy array.If True, raise an exception if conversion requires copying data.
For numpy arrays created with zero copy, return a writable view.
A NumPy array with the data.
ChunkedArray
An array-like composed from a collection of pyarrow.Arrays.chunked_array()
Construct a ChunkedArray from a list of arrays.List of arrays to compose into a ChunkedArray.
If provided, all arrays will be cast to this type.
A ChunkedArray composed of the input arrays.
Properties
num_chunks
Number of underlying chunks.The number of chunks.
chunks
List of chunks.The underlying chunks as a list.
Methods
chunk()
Select a chunk by its index.Index of the chunk to select.
The selected chunk.
Typed Array Classes
NumericArray
Base class for all numeric array types (integers and floats).IntegerArray
Base class for all integer array types.Int8Array, Int16Array, Int32Array, Int64Array
Signed integer arrays of 8, 16, 32, and 64 bits respectively.UInt8Array, UInt16Array, UInt32Array, UInt64Array
Unsigned integer arrays of 8, 16, 32, and 64 bits respectively.FloatingPointArray
Base class for floating point array types.HalfFloatArray, FloatArray, DoubleArray
Floating point arrays for 16-bit (half), 32-bit (float), and 64-bit (double) precision.BooleanArray
Boolean (true/false) array.StringArray
Variable-length UTF-8 string array.BinaryArray
Variable-length binary array.ListArray
Array of variable-length lists.StructArray
Array of structured (named fields) values.DictionaryArray
Array with dictionary encoding (categorical data).TimestampArray
Array of timestamp values with timezone and unit.Date32Array, Date64Array
Date arrays stored as 32-bit or 64-bit integers.Time32Array, Time64Array
Time of day arrays with 32-bit or 64-bit storage.DurationArray
Array of duration (time interval) values.Utility Functions
nulls()
Create an array of all null values.Number of null values.
Data type (defaults to null type).
Memory pool for allocation.
Array of null values.
repeat()
Create an array by repeating a value.Value to repeat.
Number of times to repeat the value.
Memory pool for allocation.
Array with repeated value.
concat_arrays()
Concatenate multiple arrays into a single array.Arrays to concatenate.
Memory pool for allocation.
Concatenated array.