pub type ListChunked = ChunkedArray<ListType>;
Aliased Type§
struct ListChunked { /* private fields */ }
Implementations§
Source§impl ListChunked
impl ListChunked
pub fn full_null_with_dtype( name: PlSmallStr, 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: PlSmallStr,
) -> AmortizedListIter<'_, impl Iterator<Item = Option<ArrayBox>> + '_>
pub fn amortized_iter_with_name( &self, name: PlSmallStr, ) -> 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 to_physical_repr(&self) -> Cow<'_, ListChunked>
pub fn to_physical_repr(&self) -> Cow<'_, ListChunked>
Convert the datatype of the list into the physical datatype.
Sourcepub unsafe fn from_physical_unchecked(
&self,
to_inner_dtype: DataType,
) -> PolarsResult<ListChunked>
pub unsafe fn from_physical_unchecked( &self, to_inner_dtype: DataType, ) -> PolarsResult<ListChunked>
Convert a non-logical ListChunked
back into a logical ListChunked
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<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
.
pub fn rechunk_and_trim_to_normalized_offsets(&self) -> Self
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
We cannot cast anything to or from List/LargeList
So this implementation casts the inner type
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,
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<ListType>> for ListChunked
impl ChunkCompareEq<&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§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 ChunkFull<&Series> for ListChunked
impl ChunkFull<&Series> for ListChunked
Source§fn full(name: PlSmallStr, value: &Series, length: usize) -> ListChunked
fn full(name: PlSmallStr, value: &Series, length: usize) -> ListChunked
Source§impl ChunkFullNull for ListChunked
impl ChunkFullNull for ListChunked
fn full_null(name: PlSmallStr, length: usize) -> 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,
_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 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 ChunkTakeUnchecked<ChunkedArray<UInt32Type>> for ListChunked
impl ChunkTakeUnchecked<ChunkedArray<UInt32Type>> for ListChunked
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 ListChunked
impl<I: AsRef<[IdxSize]> + ?Sized> ChunkTakeUnchecked<I> for ListChunked
Source§unsafe fn take_unchecked(&self, indices: &I) -> Self
unsafe fn take_unchecked(&self, indices: &I) -> Self
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<Column>> for ListChunked
impl FromIterator<Option<Column>> 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
fn from_par_iter_with_dtype<I>( iter: I, name: PlSmallStr, dtype: DataType, ) -> Self
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 IntoGroupsType for ListChunked
Available on crate feature algorithm_group_by
only.
impl IntoGroupsType for ListChunked
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 ListChunked
impl<'a> IntoIterator for &'a ListChunked
Source§type IntoIter = Box<dyn PolarsIterator<Item = <&'a ChunkedArray<ListType> as IntoIterator>::Item> + 'a>
type IntoIter = Box<dyn PolarsIterator<Item = <&'a ChunkedArray<ListType> as IntoIterator>::Item> + 'a>
Source§impl Serialize for ListChunked
Available on crate feature serde
only.
impl Serialize for ListChunked
serde
only.