Type Alias polars_core::datatypes::ListChunked
source · pub type ListChunked = ChunkedArray<ListType>;
Aliased Type§
struct ListChunked { /* private fields */ }
Implementations§
source§impl ListChunked
impl ListChunked
pub fn full_null_with_dtype( name: &str, length: usize, inner_dtype: &DataType ) -> ListChunked
source§impl ListChunked
impl ListChunked
source§impl ListChunked
impl ListChunked
sourcepub fn to_ndarray<N>(&self) -> PolarsResult<Array2<N::Native>>where
N: PolarsNumericType,
Available on crate feature ndarray
only.
pub fn to_ndarray<N>(&self) -> PolarsResult<Array2<N::Native>>where
N: PolarsNumericType,
ndarray
only.If all nested Series
have the same length, a 2 dimensional ndarray::Array
is returned.
source§impl ListChunked
impl ListChunked
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 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
- Arc<..>
- Vec<…>
If the returned AmortSeries
is cloned, the local copy will be replaced and a new container
will be set.
sourcepub fn amortized_iter_with_name(
&self,
name: &str
) -> AmortizedListIter<'_, impl Iterator<Item = Option<ArrayBox>> + '_>
pub fn amortized_iter_with_name( &self, name: &str ) -> AmortizedListIter<'_, impl Iterator<Item = Option<ArrayBox>> + '_>
See amortized_iter
.
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.
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>>,
pub fn for_each_amortized<F>(&self, f: F)
sourcepub fn zip_and_apply_amortized<'a, T, I, F>(
&'a self,
ca: &'a ChunkedArray<T>,
f: F
) -> Selfwhere
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>,
pub fn zip_and_apply_amortized<'a, T, I, F>(
&'a self,
ca: &'a ChunkedArray<T>,
f: F
) -> Selfwhere
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.
pub fn binary_zip_and_apply_amortized<'a, T, U, F>(
&'a self,
ca1: &'a ChunkedArray<T>,
ca2: &'a ChunkedArray<U>,
f: F
) -> Selfwhere
T: PolarsDataType,
U: PolarsDataType,
F: FnMut(Option<AmortSeries>, Option<T::Physical<'a>>, Option<U::Physical<'a>>) -> Option<Series>,
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>>,
sourcepub fn apply_amortized<F>(&self, f: F) -> Self
pub fn apply_amortized<F>(&self, f: F) -> Self
Apply a closure F
elementwise.
pub fn try_apply_amortized<F>(&self, f: F) -> PolarsResult<Self>
source§impl ListChunked
impl ListChunked
sourcepub fn inner_dtype(&self) -> &DataType
pub fn inner_dtype(&self) -> &DataType
Get the inner data type of the list.
pub fn set_inner_dtype(&mut self, dtype: DataType)
pub fn set_fast_explode(&mut self)
pub fn _can_fast_explode(&self) -> bool
sourcepub unsafe fn to_logical(&mut self, inner_dtype: DataType)
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.
sourcepub fn iter_offsets(&self) -> impl Iterator<Item = i64> + '_
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.
sourcepub fn apply_to_inner(
&self,
func: &dyn Fn(Series) -> PolarsResult<Series>
) -> PolarsResult<ListChunked>
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
impl ListChunked
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.
impl AggList for ListChunked
algorithm_group_by
only.source§impl ChunkAnyValue for ListChunked
impl ChunkAnyValue for ListChunked
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<'a> ChunkApply<'a, Series> for ListChunked
impl<'a> ChunkApply<'a, Series> for ListChunked
source§impl ChunkCast for ListChunked
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>
fn cast_with_options( &self, data_type: &DataType, options: CastOptions ) -> PolarsResult<Series>
ChunkedArray
to DataType
source§unsafe fn cast_unchecked(&self, data_type: &DataType) -> PolarsResult<Series>
unsafe fn cast_unchecked(&self, data_type: &DataType) -> PolarsResult<Series>
source§fn cast(&self, data_type: &DataType) -> PolarsResult<Series>
fn cast(&self, data_type: &DataType) -> PolarsResult<Series>
ChunkedArray
to DataType
source§impl ChunkCompare<&ChunkedArray<ListType>> for ListChunked
impl ChunkCompare<&ChunkedArray<ListType>> for ListChunked
type Item = ChunkedArray<BooleanType>
source§fn equal(&self, rhs: &ListChunked) -> BooleanChunked
fn equal(&self, rhs: &ListChunked) -> BooleanChunked
source§fn equal_missing(&self, rhs: &ListChunked) -> BooleanChunked
fn equal_missing(&self, rhs: &ListChunked) -> BooleanChunked
None == None
.source§fn not_equal(&self, rhs: &ListChunked) -> BooleanChunked
fn not_equal(&self, rhs: &ListChunked) -> BooleanChunked
source§fn not_equal_missing(&self, rhs: &ListChunked) -> BooleanChunked
fn not_equal_missing(&self, rhs: &ListChunked) -> BooleanChunked
None == None
.source§fn gt(&self, _rhs: &ListChunked) -> BooleanChunked
fn gt(&self, _rhs: &ListChunked) -> BooleanChunked
source§fn gt_eq(&self, _rhs: &ListChunked) -> BooleanChunked
fn gt_eq(&self, _rhs: &ListChunked) -> BooleanChunked
source§fn lt(&self, _rhs: &ListChunked) -> BooleanChunked
fn lt(&self, _rhs: &ListChunked) -> BooleanChunked
source§fn lt_eq(&self, _rhs: &ListChunked) -> BooleanChunked
fn lt_eq(&self, _rhs: &ListChunked) -> BooleanChunked
source§impl ChunkExpandAtIndex<ListType> for ListChunked
impl ChunkExpandAtIndex<ListType> for ListChunked
source§fn new_from_index(&self, index: usize, length: usize) -> ListChunked
fn new_from_index(&self, index: usize, length: usize) -> ListChunked
source§impl ChunkExplode for ListChunked
impl ChunkExplode for ListChunked
fn offsets(&self) -> PolarsResult<OffsetsBuffer<i64>>
fn explode_and_offsets(&self) -> PolarsResult<(Series, OffsetsBuffer<i64>)>
fn explode(&self) -> PolarsResult<Series>
source§impl ChunkFilter<ListType> for ListChunked
impl ChunkFilter<ListType> for ListChunked
source§fn filter(&self, filter: &BooleanChunked) -> PolarsResult<ListChunked>
fn filter(&self, filter: &BooleanChunked) -> PolarsResult<ListChunked>
source§impl ChunkFull<&Series> for ListChunked
impl ChunkFull<&Series> for ListChunked
source§impl ChunkFullNull for ListChunked
impl ChunkFullNull for ListChunked
source§impl ChunkQuantile<Series> for ListChunked
impl ChunkQuantile<Series> for ListChunked
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,
_interpol: QuantileInterpolOptions
) -> PolarsResult<Option<T>>
fn quantile( &self, _quantile: f64, _interpol: QuantileInterpolOptions ) -> PolarsResult<Option<T>>
None
if the array is empty or only contains null values.source§impl ChunkReverse for ListChunked
impl ChunkReverse for ListChunked
source§impl ChunkShift<ListType> for ListChunked
impl ChunkShift<ListType> for ListChunked
source§impl ChunkShiftFill<ListType, Option<&Series>> for ListChunked
impl ChunkShiftFill<ListType, Option<&Series>> for ListChunked
source§fn shift_and_fill(
&self,
periods: i64,
fill_value: Option<&Series>
) -> ListChunked
fn shift_and_fill( &self, periods: i64, fill_value: Option<&Series> ) -> ListChunked
fill_value
.source§impl ChunkVar for ListChunked
impl ChunkVar for ListChunked
source§impl Debug for ListChunked
impl Debug for ListChunked
source§impl FromIterator<Option<Box<dyn Array>>> for ListChunked
impl FromIterator<Option<Box<dyn Array>>> for ListChunked
source§impl FromIterator<Option<Series>> for ListChunked
impl FromIterator<Option<Series>> for ListChunked
source§impl<Ptr> FromIterator<Ptr> for ListChunked
impl<Ptr> FromIterator<Ptr> for ListChunked
source§fn from_iter<I: IntoIterator<Item = Ptr>>(iter: I) -> Self
fn from_iter<I: IntoIterator<Item = Ptr>>(iter: I) -> Self
source§impl FromParIterWithDtype<Option<Series>> for ListChunked
impl FromParIterWithDtype<Option<Series>> for ListChunked
source§impl FromParallelIterator<Option<Series>> for ListChunked
impl FromParallelIterator<Option<Series>> for ListChunked
source§impl FromTrustedLenIterator<Option<Series>> for ListChunked
impl FromTrustedLenIterator<Option<Series>> for ListChunked
fn from_iter_trusted_length<I: IntoIterator<Item = Option<Series>>>( iter: I ) -> Self
source§impl<Ptr> FromTrustedLenIterator<Ptr> for ListChunked
impl<Ptr> FromTrustedLenIterator<Ptr> for ListChunked
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.
impl IntoGroupsProxy for ListChunked
algorithm_group_by
only.