Module polars_arrow::array
source · Expand description
Contains the Array and MutableArray trait objects declaring arrays,
as well as concrete arrays (such as Utf8Array and MutableUtf8Array).
Fixed-length containers with optional values
that are laid in memory according to the Arrow specification.
Each array type has its own struct. The following are the main array types:
PrimitiveArrayandMutablePrimitiveArray, an array of values with a fixed length such as integers, floats, etc.BooleanArrayandMutableBooleanArray, an array of boolean values (stored as a bitmap)Utf8ArrayandMutableUtf8Array, an array of variable length utf8 valuesBinaryArrayandMutableBinaryArray, an array of opaque variable length valuesListArrayandMutableListArray, an array of arrays (e.g.[[1, 2], None, [], [None]])StructArrayandMutableStructArray, an array of arrays identified by a string (e.g.{"a": [1, 2], "b": [true, false]}) All immutable arrays implement the trait objectArrayand that can be downcasted to a concrete struct based onPhysicalTypeavailable fromArray::data_type. All immutable arrays are backed byBufferand thus cloning and slicing them isO(1).
Most arrays contain a MutableArray counterpart that is neither clonable nor sliceable, but
can be operated in-place.
Modules
Structs
- Iterator of values of an [
ArrayAccessor]. - A
BinaryArrayis Arrow’s semantically equivalent of an immutableVec<Option<Vec<u8>>>. It implementsArray. - A
BooleanArrayis Arrow’s semantically equivalent of an immutableVec<Option<bool>>. It implementsArray. - The Arrow’s equivalent to an immutable
Vec<Option<[u8; size]>>. Cloning and slicing this struct isO(1). - The Arrow’s equivalent to an immutable
Vec<Option<[T; size]>>whereTis an Arrow type. Cloning and slicing this struct isO(1). - An
Arraysemantically equivalent toVec<Option<Vec<Option<T>>>>with Arrow’s in-memory. - An array representing a (key, value), both of arbitrary logical types.
- The Arrow’s equivalent to
Vec<Option<Vec<u8>>>. Converting aMutableBinaryArrayinto aBinaryArrayisO(1). - A
MutableArraythat builds aBinaryArray. It differs fromMutableBinaryArrayin that it builds non-nullBinaryArray. - The Arrow’s equivalent to
Vec<Option<bool>>, but with1/16of its size. Converting aMutableBooleanArrayinto aBooleanArrayisO(1). - The Arrow’s equivalent to a mutable
Vec<Option<[u8; size]>>. Converting aMutableFixedSizeBinaryArrayinto aFixedSizeBinaryArrayisO(1). - The mutable version of
FixedSizeListArray. - The mutable version of
ListArray. - A distinct type to disambiguate clashing methods
- The Arrow’s equivalent to
Vec<Option<T>>whereTis byte-size (e.g.i32). Converting aMutablePrimitiveArrayinto aPrimitiveArrayisO(1). - A
MutableArraythat builds aUtf8Array. It differs fromMutableUtf8ValuesArrayin that it can build nullableUtf8Arrays. - A
MutableArraythat builds aUtf8Array. It differs fromMutableUtf8Arrayin that it builds non-nullUtf8Array. - The concrete
ArrayofArrowDataType::Null. - A
PrimitiveArrayis Arrow’s semantically equivalent of an immutableVec<Option<T>>where T isNativeType(e.g.i32). It implementsArray. - A
StructArrayis a nestedArraywith an optional validity representing multipleArraywith the same number of rows. UnionArrayrepresents an array whose each slot can contain different values.- A
Utf8Arrayis arrow’s semantic equivalent of an immutableVec<Option<String>>. Cloning and slicing this struct isO(1).
Traits
- A trait representing an immutable Arrow array. Arrow arrays are trait objects that are infallibly downcasted to concrete types according to the
Array::data_type. - Trait denoting
NativeTypes that can be used as keys of a dictionary. - Trait that
BinaryArrayandUtf8Arrayimplement for the purposes of DRY. - A trait describing a mutable array; i.e. an array whose values can be changed. Mutable arrays cannot be cloned but can be mutated in place, thereby making them useful to perform numeric operations without allocations. As in
Array, concrete arrays (such asMutablePrimitiveArray) implement how they are mutated. - A trait describing the ability of a struct to receive new items.
- A trait describing the ability of a struct to create itself from a iterator. This is similar to
Extend, but accepted the creation to error. - A trait describing the ability of a struct to extend from a reference of itself. Specialization of
TryExtend. - A trait describing the ability of a struct to receive new items.
Functions
- Clones a dynamic
Array. - Logically compares two
Arrays. Two arrays are logically equal if and only if: - Convert an
arrow_data::ArrayDatato polars_arrowArray - Returns a function that writes the element of
arrayat positionindexto aWrite, writingnullto the null slots. - Returns a function that writes the value of the element of
arrayat positionindexto aWrite, writingnullin the null slots. - Creates a new
Arraywith aArray::lenof 0. - Creates a new
ArrayofArrowDataTypedata_typeandlength. The array is guaranteed to haveArray::null_countequal toArray::lenfor all types except Union, which does not have a validity. - Convert an polars_arrow
Arraytoarrow_data::ArrayData
Type Aliases
- Iterator of values of an
BinaryArray. - A type definition
PrimitiveArrayfordays_ms - A type definition
MutablePrimitiveArrayfordays_ms - A type definition
PrimitiveArrayforf16 - A type definition
MutablePrimitiveArrayforf16 - A type definition
PrimitiveArrayforf32 - A type definition
MutablePrimitiveArrayforf32 - A type definition
PrimitiveArrayforf64 - A type definition
MutablePrimitiveArrayforf64 - A type definition
PrimitiveArrayfori8 - A type definition
MutablePrimitiveArrayfori8 - A type definition
PrimitiveArrayfori16 - A type definition
MutablePrimitiveArrayfori16 - A type definition
PrimitiveArrayfori32 - A type definition
MutablePrimitiveArrayfori32 - A type definition
PrimitiveArrayfori64 - A type definition
MutablePrimitiveArrayfori64 - A type definition
PrimitiveArrayfori128 - A type definition
MutablePrimitiveArrayfori128 - A type definition
PrimitiveArrayfori256 - A type definition
MutablePrimitiveArrayfori256 - Iterator of values of a
ListArray. - A type definition
PrimitiveArrayformonths_days_ns - A type definition
MutablePrimitiveArrayformonths_days_ns - A type definition
PrimitiveArrayforu8 - A type definition
MutablePrimitiveArrayforu8 - A type definition
PrimitiveArrayforu16 - A type definition
MutablePrimitiveArrayforu16 - A type definition
PrimitiveArrayforu32 - A type definition
MutablePrimitiveArrayforu32 - A type definition
PrimitiveArrayforu64 - A type definition
MutablePrimitiveArrayforu64 - Iterator of values of an
Utf8Array.