pub type ArrayChunked = ChunkedArray<FixedSizeListType>;
dtype-array
only.Aliased Type§
struct ArrayChunked { /* private fields */ }
Implementations§
Source§impl ArrayChunked
impl ArrayChunked
pub fn full_null_with_dtype( name: PlSmallStr, length: usize, inner_dtype: &DataType, width: usize, ) -> ArrayChunked
Source§impl ArrayChunked
impl ArrayChunked
Sourcepub fn amortized_iter(
&self,
) -> AmortizedListIter<'_, impl Iterator<Item = Option<ArrayBox>> + '_>
pub fn amortized_iter( &self, ) -> AmortizedListIter<'_, impl Iterator<Item = Option<ArrayBox>> + '_>
This is an iterator over a ArrayChunked
that save allocations.
A Series is:
1. Arc<ChunkedArray>
ChunkedArray is:
2. Vec< 3. ArrayRef>
The ArrayRef
we indicated with 3. will be updated during iteration.
The Series will be pinned in memory, saving an allocation for
- Arc<..>
- Vec<…>
§Warning
Though memory safe in the sense that it will not read unowned memory, UB, or memory leaks
this function still needs precautions. The returned should never be cloned or taken longer
than a single iteration, as every call on next
of the iterator will change the contents of
that Series.
§Safety
The lifetime of AmortSeries is bound to the iterator. Keeping it alive longer than the iterator is UB.
Sourcepub fn amortized_iter_with_name(
&self,
name: PlSmallStr,
) -> AmortizedListIter<'_, impl Iterator<Item = Option<ArrayBox>> + '_>
pub fn amortized_iter_with_name( &self, name: PlSmallStr, ) -> AmortizedListIter<'_, impl Iterator<Item = Option<ArrayBox>> + '_>
This is an iterator over a ArrayChunked
that save allocations.
A Series is:
1. Arc<ChunkedArray>
ChunkedArray is:
2. Vec< 3. ArrayRef>
The ArrayRef we indicated with 3. will be updated during iteration. The Series will be pinned in memory, saving an allocation for
- Arc<..>
- Vec<…>
If the returned AmortSeries
is cloned, the local copy will be replaced and a new container
will be set.
pub fn try_apply_amortized_to_list<F>(&self, f: F) -> PolarsResult<ListChunked>
Sourcepub unsafe fn apply_amortized_same_type<F>(&self, f: F) -> Self
pub unsafe fn apply_amortized_same_type<F>(&self, f: F) -> Self
Apply a closure F
to each array.
§Safety
Return series of F
must has the same dtype and number of elements as input.
Sourcepub unsafe fn try_apply_amortized_same_type<F>(
&self,
f: F,
) -> PolarsResult<Self>
pub unsafe fn try_apply_amortized_same_type<F>( &self, f: F, ) -> PolarsResult<Self>
Try apply a closure F
to each array.
§Safety
Return series of F
must has the same dtype and number of elements as input if it is Ok.
Sourcepub unsafe fn zip_and_apply_amortized_same_type<'a, T, F>(
&'a self,
ca: &'a ChunkedArray<T>,
f: F,
) -> Self
pub unsafe fn zip_and_apply_amortized_same_type<'a, T, F>( &'a self, ca: &'a ChunkedArray<T>, f: F, ) -> Self
Zip with a ChunkedArray
then apply a binary function F
elementwise.
§Safety
Sourcepub fn apply_amortized_generic<F, K, V>(&self, f: F) -> ChunkedArray<V>where
V: PolarsDataType,
F: FnMut(Option<AmortSeries>) -> Option<K> + Copy,
V::Array: ArrayFromIter<Option<K>>,
pub fn apply_amortized_generic<F, K, V>(&self, f: F) -> ChunkedArray<V>where
V: PolarsDataType,
F: FnMut(Option<AmortSeries>) -> Option<K> + Copy,
V::Array: ArrayFromIter<Option<K>>,
Apply a closure F
elementwise.
Sourcepub fn try_apply_amortized_generic<F, K, V>(
&self,
f: F,
) -> PolarsResult<ChunkedArray<V>>where
V: PolarsDataType,
F: FnMut(Option<AmortSeries>) -> PolarsResult<Option<K>> + Copy,
V::Array: ArrayFromIter<Option<K>>,
pub fn try_apply_amortized_generic<F, K, V>(
&self,
f: F,
) -> PolarsResult<ChunkedArray<V>>where
V: PolarsDataType,
F: FnMut(Option<AmortSeries>) -> PolarsResult<Option<K>> + Copy,
V::Array: ArrayFromIter<Option<K>>,
Try apply a closure F
elementwise.
pub fn for_each_amortized<F>(&self, f: F)
Source§impl ArrayChunked
impl ArrayChunked
Sourcepub fn inner_dtype(&self) -> &DataType
pub fn inner_dtype(&self) -> &DataType
Get the inner data type of the fixed size list.
pub fn width(&self) -> usize
Sourcepub unsafe fn to_logical(&mut self, inner_dtype: DataType)
pub unsafe fn to_logical(&mut self, inner_dtype: DataType)
§Safety
The caller must ensure that the logical type given fits the physical type of the array.
Sourcepub fn to_physical_repr(&self) -> Cow<'_, ArrayChunked>
pub fn to_physical_repr(&self) -> Cow<'_, ArrayChunked>
Convert the datatype of the array into the physical datatype.
Sourcepub unsafe fn from_physical_unchecked(
&self,
to_inner_dtype: DataType,
) -> PolarsResult<Self>
pub unsafe fn from_physical_unchecked( &self, to_inner_dtype: DataType, ) -> PolarsResult<Self>
Convert a non-logical ArrayChunked
back into a logical ArrayChunked
without casting.
§Safety
This can lead to invalid memory access in downstream code.
Sourcepub fn apply_to_inner(
&self,
func: &dyn Fn(Series) -> PolarsResult<Series>,
) -> PolarsResult<ArrayChunked>
pub fn apply_to_inner( &self, func: &dyn Fn(Series) -> PolarsResult<Series>, ) -> PolarsResult<ArrayChunked>
Ignore the list indices and apply func
to the inner type as Series
.
Sourcepub fn get_leaf_array(&self) -> Series
pub fn get_leaf_array(&self) -> Series
Recurse nested types until we are at the leaf array.
Source§impl ArrayChunked
impl ArrayChunked
pub fn get_as_series(&self, idx: usize) -> Option<Series>
Trait Implementations§
Source§impl AggList for ArrayChunked
Available on crate feature algorithm_group_by
only.
impl AggList for ArrayChunked
algorithm_group_by
only.Source§impl ChunkAnyValue for ArrayChunked
impl ChunkAnyValue for ArrayChunked
Source§unsafe fn get_any_value_unchecked(&self, index: usize) -> AnyValue<'_>
unsafe fn get_any_value_unchecked(&self, index: usize) -> AnyValue<'_>
Source§fn get_any_value(&self, index: usize) -> PolarsResult<AnyValue<'_>>
fn get_any_value(&self, index: usize) -> PolarsResult<AnyValue<'_>>
Source§impl ChunkCast for ArrayChunked
We cannot cast anything to or from List/LargeList
So this implementation casts the inner type
impl ChunkCast for ArrayChunked
We cannot cast anything to or from List/LargeList So this implementation casts the inner type
Source§fn cast_with_options(
&self,
dtype: &DataType,
options: CastOptions,
) -> PolarsResult<Series>
fn cast_with_options( &self, dtype: &DataType, options: CastOptions, ) -> PolarsResult<Series>
ChunkedArray
to DataType
Source§unsafe fn cast_unchecked(&self, dtype: &DataType) -> PolarsResult<Series>
unsafe fn cast_unchecked(&self, dtype: &DataType) -> PolarsResult<Series>
Source§fn cast(&self, dtype: &DataType) -> PolarsResult<Series>
fn cast(&self, dtype: &DataType) -> PolarsResult<Series>
ChunkedArray
to DataType
Source§impl ChunkCompareEq<&ChunkedArray<FixedSizeListType>> for ArrayChunked
impl ChunkCompareEq<&ChunkedArray<FixedSizeListType>> for ArrayChunked
type Item = ChunkedArray<BooleanType>
Source§fn equal(&self, rhs: &ArrayChunked) -> BooleanChunked
fn equal(&self, rhs: &ArrayChunked) -> BooleanChunked
Source§fn equal_missing(&self, rhs: &ArrayChunked) -> BooleanChunked
fn equal_missing(&self, rhs: &ArrayChunked) -> BooleanChunked
None == None
.Source§fn not_equal(&self, rhs: &ArrayChunked) -> BooleanChunked
fn not_equal(&self, rhs: &ArrayChunked) -> BooleanChunked
Source§fn not_equal_missing(&self, rhs: &ArrayChunked) -> Self::Item
fn not_equal_missing(&self, rhs: &ArrayChunked) -> Self::Item
None == None
.Source§impl ChunkExpandAtIndex<FixedSizeListType> for ArrayChunked
impl ChunkExpandAtIndex<FixedSizeListType> for ArrayChunked
Source§fn new_from_index(&self, index: usize, length: usize) -> ArrayChunked
fn new_from_index(&self, index: usize, length: usize) -> ArrayChunked
Source§impl ChunkExplode for ArrayChunked
impl ChunkExplode for ArrayChunked
fn offsets(&self) -> PolarsResult<OffsetsBuffer<i64>>
fn explode_and_offsets(&self) -> PolarsResult<(Series, OffsetsBuffer<i64>)>
fn explode(&self) -> PolarsResult<Series>
Source§impl ChunkFull<&Series> for ArrayChunked
impl ChunkFull<&Series> for ArrayChunked
Source§fn full(name: PlSmallStr, value: &Series, length: usize) -> ArrayChunked
fn full(name: PlSmallStr, value: &Series, length: usize) -> ArrayChunked
Source§impl ChunkFullNull for ArrayChunked
impl ChunkFullNull for ArrayChunked
fn full_null(name: PlSmallStr, length: usize) -> ArrayChunked
Source§impl ChunkQuantile<Series> for ArrayChunked
impl ChunkQuantile<Series> for ArrayChunked
Source§fn median(&self) -> Option<T>
fn median(&self) -> Option<T>
None
if the array is empty or only contains null values.Source§fn quantile(
&self,
_quantile: f64,
_method: QuantileMethod,
) -> PolarsResult<Option<T>>
fn quantile( &self, _quantile: f64, _method: QuantileMethod, ) -> PolarsResult<Option<T>>
None
if the array is empty or only contains null values.Source§impl ChunkReverse for ArrayChunked
impl ChunkReverse for ArrayChunked
Source§impl ChunkShift<FixedSizeListType> for ArrayChunked
impl ChunkShift<FixedSizeListType> for ArrayChunked
Source§impl ChunkShiftFill<FixedSizeListType, Option<&Series>> for ArrayChunked
impl ChunkShiftFill<FixedSizeListType, Option<&Series>> for ArrayChunked
Source§fn shift_and_fill(
&self,
periods: i64,
fill_value: Option<&Series>,
) -> ArrayChunked
fn shift_and_fill( &self, periods: i64, fill_value: Option<&Series>, ) -> ArrayChunked
fill_value
.Source§impl ChunkTakeUnchecked<ChunkedArray<UInt32Type>> for ArrayChunked
impl ChunkTakeUnchecked<ChunkedArray<UInt32Type>> for ArrayChunked
Source§unsafe fn take_unchecked(&self, indices: &IdxCa) -> Self
unsafe fn take_unchecked(&self, indices: &IdxCa) -> Self
Source§impl<I: AsRef<[IdxSize]> + ?Sized> ChunkTakeUnchecked<I> for ArrayChunked
impl<I: AsRef<[IdxSize]> + ?Sized> ChunkTakeUnchecked<I> for ArrayChunked
Source§unsafe fn take_unchecked(&self, indices: &I) -> Self
unsafe fn take_unchecked(&self, indices: &I) -> Self
Source§impl ChunkVar for ArrayChunked
impl ChunkVar for ArrayChunked
Source§impl Debug for ArrayChunked
impl Debug for ArrayChunked
Source§impl IntoGroupsType for ArrayChunked
Available on crate feature algorithm_group_by
only.
impl IntoGroupsType for ArrayChunked
algorithm_group_by
only.Source§fn group_tuples<'a>(
&'a self,
_multithreaded: bool,
_sorted: bool,
) -> PolarsResult<GroupsType>
fn group_tuples<'a>( &'a self, _multithreaded: bool, _sorted: bool, ) -> PolarsResult<GroupsType>
Source§impl<'a> IntoIterator for &'a ArrayChunked
impl<'a> IntoIterator for &'a ArrayChunked
Source§type IntoIter = Box<dyn PolarsIterator<Item = <&'a ChunkedArray<FixedSizeListType> as IntoIterator>::Item> + 'a>
type IntoIter = Box<dyn PolarsIterator<Item = <&'a ChunkedArray<FixedSizeListType> as IntoIterator>::Item> + 'a>
Source§impl Serialize for ArrayChunked
Available on crate feature serde
only.
impl Serialize for ArrayChunked
serde
only.