Type Alias polars_core::datatypes::ListChunked

source ·
pub type ListChunked = ChunkedArray<ListType>;

Aliased Type§

struct ListChunked { /* private fields */ }

Implementations§

source§

impl ListChunked

source

pub fn full_null_with_dtype( name: &str, length: usize, inner_dtype: &DataType ) -> ListChunked

source§

impl ListChunked

source

pub fn par_iter(&self) -> impl ParallelIterator<Item = Option<Series>> + '_

source

pub fn par_iter_indexed( &mut self ) -> impl IndexedParallelIterator<Item = Option<Series>> + '_

source§

impl ListChunked

source

pub fn to_ndarray<N>(&self) -> PolarsResult<Array2<N::Native>>

Available on crate feature ndarray only.

If all nested Series have the same length, a 2 dimensional ndarray::Array is returned.

source§

impl ListChunked

source

pub fn amortized_iter( &self ) -> AmortizedListIter<'_, impl Iterator<Item = Option<ArrayBox>> + '_>

This is an iterator over a ListChunked that saves 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

  1. Arc<..>
  2. Vec<…>

If the returned AmortSeries is cloned, the local copy will be replaced and a new container will be set.

source

pub fn amortized_iter_with_name( &self, name: &str ) -> AmortizedListIter<'_, impl Iterator<Item = Option<ArrayBox>> + '_>

See amortized_iter.

source

pub fn apply_amortized_generic<F, K, V>(&self, f: F) -> ChunkedArray<V>

Apply a closure F elementwise.

source

pub fn try_apply_amortized_generic<F, K, V>( &self, f: F ) -> PolarsResult<ChunkedArray<V>>

source

pub fn for_each_amortized<F>(&self, f: F)

source

pub fn zip_and_apply_amortized<'a, T, I, F>( &'a self, ca: &'a ChunkedArray<T>, f: F ) -> Self
where T: PolarsDataType, &'a ChunkedArray<T>: IntoIterator<IntoIter = I>, I: TrustedLen<Item = Option<T::Physical<'a>>>, F: FnMut(Option<AmortSeries>, Option<T::Physical<'a>>) -> Option<Series>,

Zip with a ChunkedArray then apply a binary function F elementwise.

source

pub fn binary_zip_and_apply_amortized<'a, T, U, F>( &'a self, ca1: &'a ChunkedArray<T>, ca2: &'a ChunkedArray<U>, f: F ) -> Self

source

pub fn try_zip_and_apply_amortized<'a, T, I, F>( &'a self, ca: &'a ChunkedArray<T>, f: F ) -> PolarsResult<Self>
where T: PolarsDataType, &'a ChunkedArray<T>: IntoIterator<IntoIter = I>, I: TrustedLen<Item = Option<T::Physical<'a>>>, F: FnMut(Option<AmortSeries>, Option<T::Physical<'a>>) -> PolarsResult<Option<Series>>,

source

pub fn apply_amortized<F>(&self, f: F) -> Self
where F: FnMut(AmortSeries) -> Series,

Apply a closure F elementwise.

source

pub fn try_apply_amortized<F>(&self, f: F) -> PolarsResult<Self>

source§

impl ListChunked

source

pub fn inner_dtype(&self) -> &DataType

Get the inner data type of the list.

source

pub fn set_inner_dtype(&mut self, dtype: DataType)

source

pub fn set_fast_explode(&mut self)

source

pub fn _can_fast_explode(&self) -> bool

source

pub unsafe fn to_logical(&mut self, inner_dtype: DataType)

Set the logical type of the ListChunked.

§Safety

The caller must ensure that the logical type given fits the physical type of the array.

source

pub fn get_inner(&self) -> Series

Get the inner values as Series, ignoring the list offsets.

source

pub fn iter_offsets(&self) -> impl Iterator<Item = i64> + '_

Returns an iterator over the offsets of this chunked array.

The offsets are returned as though the array consisted of a single chunk.

source

pub fn apply_to_inner( &self, func: &dyn Fn(Series) -> PolarsResult<Series> ) -> PolarsResult<ListChunked>

Ignore the list indices and apply func to the inner type as Series.

source§

impl ListChunked

source

pub fn get_as_series(&self, idx: usize) -> Option<Series>

Trait Implementations§

source§

impl AggList for ListChunked

Available on crate feature algorithm_group_by only.
source§

unsafe fn agg_list(&self, groups: &GroupsProxy) -> Series

Safety Read more
source§

impl ChunkAnyValue for ListChunked

source§

unsafe fn get_any_value_unchecked(&self, index: usize) -> AnyValue<'_>

Get a single value. Beware this is slow. If you need to use this slightly performant, cast Categorical to UInt32 Read more
source§

fn get_any_value(&self, index: usize) -> PolarsResult<AnyValue<'_>>

Get a single value. Beware this is slow.
source§

impl<'a> ChunkApply<'a, Series> for ListChunked

source§

fn apply_values<F>(&'a self, f: F) -> Self
where F: Fn(Series) -> Series + Copy,

Apply a closure F elementwise.

§

type FuncRet = Series

source§

fn apply<F>(&'a self, f: F) -> Self
where F: Fn(Option<Series>) -> Option<Series> + Copy,

Apply a closure elementwise including null values.
source§

fn apply_to_slice<F, T>(&'a self, f: F, slice: &mut [T])
where F: Fn(Option<Series>, &T) -> T,

Apply a closure elementwise and write results to a mutable slice.
source§

impl ChunkCast for ListChunked

We cannot cast anything to or from List/LargeList So this implementation casts the inner type

source§

fn cast_with_options( &self, data_type: &DataType, options: CastOptions ) -> PolarsResult<Series>

source§

unsafe fn cast_unchecked(&self, data_type: &DataType) -> PolarsResult<Series>

Does not check if the cast is a valid one and may over/underflow Read more
source§

fn cast(&self, data_type: &DataType) -> PolarsResult<Series>

source§

impl ChunkCompare<&ChunkedArray<ListType>> for ListChunked

§

type Item = ChunkedArray<BooleanType>

source§

fn equal(&self, rhs: &ListChunked) -> BooleanChunked

Check for equality.
source§

fn equal_missing(&self, rhs: &ListChunked) -> BooleanChunked

Check for equality where None == None.
source§

fn not_equal(&self, rhs: &ListChunked) -> BooleanChunked

Check for inequality.
source§

fn not_equal_missing(&self, rhs: &ListChunked) -> BooleanChunked

Check for inequality where None == None.
source§

fn gt(&self, _rhs: &ListChunked) -> BooleanChunked

Greater than comparison.
source§

fn gt_eq(&self, _rhs: &ListChunked) -> BooleanChunked

Greater than or equal comparison.
source§

fn lt(&self, _rhs: &ListChunked) -> BooleanChunked

Less than comparison.
source§

fn lt_eq(&self, _rhs: &ListChunked) -> BooleanChunked

Less than or equal comparison
source§

impl ChunkExpandAtIndex<ListType> for ListChunked

source§

fn new_from_index(&self, index: usize, length: usize) -> ListChunked

Create a new ChunkedArray filled with values at that index.
source§

impl ChunkExplode for ListChunked

source§

fn offsets(&self) -> PolarsResult<OffsetsBuffer<i64>>

source§

fn explode_and_offsets(&self) -> PolarsResult<(Series, OffsetsBuffer<i64>)>

source§

fn explode(&self) -> PolarsResult<Series>

source§

impl ChunkFilter<ListType> for ListChunked

source§

fn filter(&self, filter: &BooleanChunked) -> PolarsResult<ListChunked>

Filter values in the ChunkedArray with a boolean mask. Read more
source§

impl ChunkFull<&Series> for ListChunked

source§

fn full(name: &str, value: &Series, length: usize) -> ListChunked

Create a ChunkedArray with a single value.
source§

impl ChunkFullNull for ListChunked

source§

fn full_null(name: &str, length: usize) -> ListChunked

source§

impl ChunkQuantile<Series> for ListChunked

source§

fn median(&self) -> Option<T>

Returns the mean value in the array. Returns None if the array is empty or only contains null values.
source§

fn quantile( &self, _quantile: f64, _interpol: QuantileInterpolOptions ) -> PolarsResult<Option<T>>

Aggregate a given quantile of the ChunkedArray. Returns None if the array is empty or only contains null values.
source§

impl ChunkReverse for ListChunked

source§

fn reverse(&self) -> Self

Return a reversed version of this array.
source§

impl ChunkShift<ListType> for ListChunked

source§

fn shift(&self, periods: i64) -> Self

source§

impl ChunkShiftFill<ListType, Option<&Series>> for ListChunked

source§

fn shift_and_fill( &self, periods: i64, fill_value: Option<&Series> ) -> ListChunked

Shift the values by a given period and fill the parts that will be empty due to this operation with fill_value.
source§

impl ChunkVar for ListChunked

source§

fn var(&self, _ddof: u8) -> Option<f64>

Compute the variance of this ChunkedArray/Series.
source§

fn std(&self, _ddof: u8) -> Option<f64>

Compute the standard deviation of this ChunkedArray/Series.
source§

impl Debug for ListChunked

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl FromIterator<Option<Box<dyn Array>>> for ListChunked

source§

fn from_iter<I: IntoIterator<Item = Option<Box<dyn Array>>>>(iter: I) -> Self

Creates a value from an iterator. Read more
source§

impl FromIterator<Option<Series>> for ListChunked

source§

fn from_iter<I: IntoIterator<Item = Option<Series>>>(iter: I) -> Self

Creates a value from an iterator. Read more
source§

impl<Ptr> FromIterator<Ptr> for ListChunked
where Ptr: Borrow<Series>,

source§

fn from_iter<I: IntoIterator<Item = Ptr>>(iter: I) -> Self

Creates a value from an iterator. Read more
source§

impl FromParIterWithDtype<Option<Series>> for ListChunked

source§

fn from_par_iter_with_dtype<I>(iter: I, name: &str, dtype: DataType) -> Self
where I: IntoParallelIterator<Item = Option<Series>>, Self: Sized,

source§

impl FromParallelIterator<Option<Series>> for ListChunked

source§

fn from_par_iter<I>(par_iter: I) -> Self
where I: IntoParallelIterator<Item = Option<Series>>,

Creates an instance of the collection from the parallel iterator par_iter. Read more
source§

impl FromTrustedLenIterator<Option<Series>> for ListChunked

source§

fn from_iter_trusted_length<I: IntoIterator<Item = Option<Series>>>( iter: I ) -> Self

source§

impl<Ptr> FromTrustedLenIterator<Ptr> for ListChunked
where Ptr: Borrow<Series>,

source§

fn from_iter_trusted_length<I: IntoIterator<Item = Ptr>>(iter: I) -> Self

source§

impl IntoGroupsProxy for ListChunked

Available on crate feature algorithm_group_by only.
source§

fn group_tuples<'a>( &'a self, multithreaded: bool, sorted: bool ) -> PolarsResult<GroupsProxy>

Create the tuples need for a group_by operation. * The first value in the tuple is the first index of the group. * The second value in the tuple is the indexes of the groups including the first value.
source§

impl<'a> IntoIterator for &'a ListChunked

§

type Item = Option<Series>

The type of the elements being iterated over.
§

type IntoIter = Box<dyn PolarsIterator<Item = <&'a ChunkedArray<ListType> as IntoIterator>::Item> + 'a>

Which kind of iterator are we turning this into?
source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
source§

impl ValueSize for ListChunked

source§

fn get_values_size(&self) -> usize

Get the values size that is still “visible” to the underlying array. E.g. take the offsets into account.