Struct polars_core::chunked_array::ChunkedArray
source · [−]pub struct ChunkedArray<T> { /* private fields */ }
Expand description
ChunkedArray
Every Series contains a ChunkedArray<T>
. Unlike Series, ChunkedArray’s are typed. This allows
us to apply closures to the data and collect the results to a ChunkedArray
of the same type T
.
Below we use an apply to use the cosine function to the values of a ChunkedArray
.
fn apply_cosine(ca: &Float32Chunked) -> Float32Chunked {
ca.apply(|v| v.cos())
}
If we would like to cast the result we could use a Rust Iterator instead of an apply
method.
Note that Iterators are slightly slower as the null values aren’t ignored implicitly.
fn apply_cosine_and_cast(ca: &Float32Chunked) -> Float64Chunked {
ca.into_iter()
.map(|opt_v| {
opt_v.map(|v| v.cos() as f64)
}).collect()
}
Another option is to first cast and then use an apply.
fn apply_cosine_and_cast(ca: &Float32Chunked) -> Float64Chunked {
ca.apply_cast_numeric(|v| v.cos() as f64)
}
Conversion between Series and ChunkedArray’s
Conversion from a Series
to a ChunkedArray
is effortless.
fn to_chunked_array(series: &Series) -> Result<&Int32Chunked>{
series.i32()
}
fn to_series(ca: Int32Chunked) -> Series {
ca.into_series()
}
Iterators
ChunkedArrays
fully support Rust native Iterator
and DoubleEndedIterator traits, thereby
giving access to all the excellent methods available for Iterators.
fn iter_forward(ca: &Float32Chunked) {
ca.into_iter()
.for_each(|opt_v| println!("{:?}", opt_v))
}
fn iter_backward(ca: &Float32Chunked) {
ca.into_iter()
.rev()
.for_each(|opt_v| println!("{:?}", opt_v))
}
Memory layout
ChunkedArray
’s use Apache Arrow as backend for the memory layout.
Arrows memory is immutable which makes it possible to make multiple zero copy (sub)-views from a single array.
To be able to append data, Polars uses chunks to append new memory locations, hence the ChunkedArray<T>
data structure.
Appends are cheap, because it will not lead to a full reallocation of the whole array (as could be the case with a Rust Vec).
However, multiple chunks in a ChunkArray
will slow down many operations that need random access because we have an extra indirection
and indexes need to be mapped to the proper chunk. Arithmetic may also be slowed down by this.
When multiplying two ChunkArray'
s with different chunk sizes they cannot utilize SIMD for instance.
If you want to have predictable performance (no unexpected re-allocation of memory), it is advised to call the rechunk after multiple append operations.
See also ChunkedArray::extend
for appends within a chunk.
Implementations
sourceimpl<T: PolarsNumericType> ChunkedArray<T> where
T::Native: Signed,
impl<T: PolarsNumericType> ChunkedArray<T> where
T::Native: Signed,
sourceimpl<T> ChunkedArray<T> where
T: PolarsNumericType,
impl<T> ChunkedArray<T> where
T: PolarsNumericType,
sourcepub fn append(&mut self, other: &Self)
pub fn append(&mut self, other: &Self)
Append in place. This is done by adding the chunks of other
to this ChunkedArray
.
See also extend
for appends to the underlying memory
sourceimpl<T: PolarsNumericType> ChunkedArray<T>
impl<T: PolarsNumericType> ChunkedArray<T>
sourcepub fn cast_and_apply_in_place<F, S>(&self, f: F) -> ChunkedArray<S> where
F: Fn(S::Native) -> S::Native + Copy,
S: PolarsNumericType,
pub fn cast_and_apply_in_place<F, S>(&self, f: F) -> ChunkedArray<S> where
F: Fn(S::Native) -> S::Native + Copy,
S: PolarsNumericType,
Cast a numeric array to another numeric data type and apply a function in place. This saves an allocation.
impl ChunkedArray<Float32Type>
Used to save compilation paths. Use carefully. Although this is safe, if misused it can lead to incorrect results.
sourceimpl<T> ChunkedArray<T> where
T: PolarsNumericType,
impl<T> ChunkedArray<T> where
T: PolarsNumericType,
sourcepub fn extend(&mut self, other: &Self)
pub fn extend(&mut self, other: &Self)
Extend the memory backed by this array with the values from other
.
Different from ChunkedArray::append
which adds chunks to this ChunkedArray
extent
appends the data from other
to the underlying PrimitiveArray
and thus may cause a reallocation.
However if this does not cause a reallocation, the resulting data structure will not have any extra chunks and thus will yield faster queries.
Prefer extend
over append
when you want to do a query after a single append. For instance during
online operations where you add n
rows and rerun a query.
Prefer append
over extend
when you want to append many times before doing a query. For instance
when you read in multiple files and when to store them in a single DataFrame
.
In the latter case finish the sequence of append
operations with a rechunk
.
sourceimpl ChunkedArray<ListType>
impl ChunkedArray<ListType>
pub fn full_null_with_dtype(
name: &str,
length: usize,
inner_dtype: &DataType
) -> ListChunked
sourceimpl<T> ChunkedArray<T> where
ChunkedArray<T>: IntoSeries,
T: PolarsFloatType,
T::Native: Float + IsFloat + SubAssign + Pow<T::Native, Output = T::Native>,
impl<T> ChunkedArray<T> where
ChunkedArray<T>: IntoSeries,
T: PolarsFloatType,
T::Native: Float + IsFloat + SubAssign + Pow<T::Native, Output = T::Native>,
sourcepub fn rolling_apply_float<F>(&self, window_size: usize, f: F) -> Result<Self> where
F: Fn(&ChunkedArray<T>) -> Option<T::Native>,
pub fn rolling_apply_float<F>(&self, window_size: usize, f: F) -> Result<Self> where
F: Fn(&ChunkedArray<T>) -> Option<T::Native>,
Apply a rolling custom function. This is pretty slow because of dynamic dispatch.
sourceimpl<T> ChunkedArray<T> where
T: PolarsFloatType,
T::Native: Float,
impl<T> ChunkedArray<T> where
T: PolarsFloatType,
T::Native: Float,
pub fn is_nan(&self) -> BooleanChunked
pub fn is_not_nan(&self) -> BooleanChunked
pub fn is_finite(&self) -> BooleanChunked
pub fn is_infinite(&self) -> BooleanChunked
sourcepub fn none_to_nan(&self) -> Self
pub fn none_to_nan(&self) -> Self
Convert missing values to NaN
values.
sourceimpl ChunkedArray<ListType>
impl ChunkedArray<ListType>
pub fn par_iter(&self) -> impl ParallelIterator<Item = Option<Series>> + '_
sourceimpl ChunkedArray<Utf8Type>
impl ChunkedArray<Utf8Type>
pub fn par_iter_indexed(
&self
) -> impl IndexedParallelIterator<Item = Option<&str>>
pub fn par_iter(&self) -> impl ParallelIterator<Item = Option<&str>> + '_
sourceimpl<T> ChunkedArray<T> where
T: PolarsNumericType,
impl<T> ChunkedArray<T> where
T: PolarsNumericType,
sourcepub fn to_ndarray(&self) -> Result<ArrayView1<'_, T::Native>>
Available on crate feature ndarray
only.
pub fn to_ndarray(&self) -> Result<ArrayView1<'_, T::Native>>
ndarray
only.If data is aligned in a single chunk and has no Null values a zero copy view is returned
as an ndarray
sourceimpl ChunkedArray<ListType>
impl ChunkedArray<ListType>
sourcepub fn to_ndarray<N>(&self) -> Result<Array2<N::Native>> where
N: PolarsNumericType,
Available on crate feature ndarray
only.
pub fn to_ndarray<N>(&self) -> Result<Array2<N::Native>> where
N: PolarsNumericType,
ndarray
only.If all nested Series
have the same length, a 2 dimensional ndarray::Array
is returned.
sourceimpl ChunkedArray<ListType>
impl ChunkedArray<ListType>
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 save allocations.
A Series is:
1. Arc
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.
sourcepub fn apply_amortized<'a, F>(&'a self, f: F) -> Self where
F: FnMut(UnstableSeries<'a>) -> Series,
pub fn apply_amortized<'a, F>(&'a self, f: F) -> Self where
F: FnMut(UnstableSeries<'a>) -> Series,
Apply a closure F
elementwise.
pub fn try_apply_amortized<'a, F>(&'a self, f: F) -> Result<Self> where
F: FnMut(UnstableSeries<'a>) -> Result<Series>,
sourceimpl ChunkedArray<ListType>
impl ChunkedArray<ListType>
pub fn set_fast_explode(&mut self)
pub fn to_logical(&mut self, inner_dtype: DataType)
sourceimpl<T> ChunkedArray<ObjectType<T>> where
T: PolarsObject,
impl<T> ChunkedArray<ObjectType<T>> where
T: PolarsObject,
pub fn new_from_vec(name: &str, v: Vec<T>) -> Self
object
only.sourceimpl<T> ChunkedArray<ObjectType<T>> where
T: PolarsObject,
impl<T> ChunkedArray<ObjectType<T>> where
T: PolarsObject,
sourcepub unsafe fn get_object_unchecked(
&self,
index: usize
) -> Option<&dyn PolarsObjectSafe>
Available on crate feature object
only.
pub unsafe fn get_object_unchecked(
&self,
index: usize
) -> Option<&dyn PolarsObjectSafe>
object
only.Get a hold to an object that can be formatted or downcasted via the Any trait.
Safety
No bounds checks
sourcepub fn get_object(&self, index: usize) -> Option<&dyn PolarsObjectSafe>
Available on crate feature object
only.
pub fn get_object(&self, index: usize) -> Option<&dyn PolarsObjectSafe>
object
only.Get a hold to an object that can be formatted or downcasted via the Any trait.
sourceimpl<T> ChunkedArray<T> where
T: PolarsNumericType,
Standard: Distribution<T::Native>,
impl<T> ChunkedArray<T> where
T: PolarsNumericType,
Standard: Distribution<T::Native>,
sourceimpl<T> ChunkedArray<T> where
ChunkedArray<T>: ChunkTake,
impl<T> ChunkedArray<T> where
ChunkedArray<T>: ChunkTake,
sourceimpl<T> ChunkedArray<T> where
T: PolarsNumericType,
T::Native: Float,
impl<T> ChunkedArray<T> where
T: PolarsNumericType,
T::Native: Float,
sourcepub fn rand_normal(
name: &str,
length: usize,
mean: f64,
std_dev: f64
) -> Result<Self>
Available on crate feature random
only.
pub fn rand_normal(
name: &str,
length: usize,
mean: f64,
std_dev: f64
) -> Result<Self>
random
only.Create ChunkedArray
with samples from a Normal distribution.
sourcepub fn rand_standard_normal(name: &str, length: usize) -> Self
Available on crate feature random
only.
pub fn rand_standard_normal(name: &str, length: usize) -> Self
random
only.Create ChunkedArray
with samples from a Standard Normal distribution.
sourceimpl ChunkedArray<Utf8Type>
impl ChunkedArray<Utf8Type>
pub fn hex_decode(&self, strict: Option<bool>) -> Result<Utf8Chunked>
pub fn hex_encode(&self) -> Utf8Chunked
pub fn base64_decode(&self, strict: Option<bool>) -> Result<Utf8Chunked>
pub fn base64_encode(&self) -> Utf8Chunked
sourceimpl<T> ChunkedArray<T>
impl<T> ChunkedArray<T>
sourcepub fn set_sorted(&mut self, reverse: bool)
pub fn set_sorted(&mut self, reverse: bool)
Set the ‘sorted’ bit meta info.
pub fn set_sorted2(&mut self, sorted: IsSorted)
sourcepub fn first_non_null(&self) -> Option<usize>
pub fn first_non_null(&self) -> Option<usize>
Get the index of the first non null value in this ChunkedArray.
sourcepub fn iter_validities(&self) -> impl Iterator<Item = Option<&Bitmap>> + '_
pub fn iter_validities(&self) -> impl Iterator<Item = Option<&Bitmap>> + '_
Get the buffer of bits representing null values
sourcepub fn has_validity(&self) -> bool
pub fn has_validity(&self) -> bool
Return if any the chunks in this [ChunkedArray]
have a validity bitmap.
no bitmap means no null values.
sourcepub fn shrink_to_fit(&mut self)
pub fn shrink_to_fit(&mut self)
Shrink the capacity of this array to fit it’s length.
sourcepub fn unpack_series_matching_type(
&self,
series: &Series
) -> Result<&ChunkedArray<T>>
pub fn unpack_series_matching_type(
&self,
series: &Series
) -> Result<&ChunkedArray<T>>
Series to ChunkedArray
sourcepub fn chunk_id(&self) -> ChunkIdIter<'_>
pub fn chunk_id(&self) -> ChunkIdIter<'_>
Unique id representing the number of chunks
sourcepub fn chunks(&self) -> &Vec<ArrayRef>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
pub fn chunks(&self) -> &Vec<ArrayRef>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
A reference to the chunks
sourcepub fn is_optimal_aligned(&self) -> bool
pub fn is_optimal_aligned(&self) -> bool
Returns true if contains a single chunk and has no null values
sourcepub fn null_count(&self) -> usize
pub fn null_count(&self) -> usize
Count the null values.
sourcepub fn append_array(&mut self, other: ArrayRef) -> Result<()>
pub fn append_array(&mut self, other: ArrayRef) -> Result<()>
Append arrow array in place.
let mut array = Int32Chunked::new("array", &[1, 2]);
let array_2 = Int32Chunked::new("2nd", &[3]);
array.append(&array_2);
assert_eq!(Vec::from(&array), [Some(1), Some(2), Some(3)])
sourcepub fn is_null(&self) -> BooleanChunked
pub fn is_null(&self) -> BooleanChunked
Get a mask of the null values.
sourcepub fn is_not_null(&self) -> BooleanChunked
pub fn is_not_null(&self) -> BooleanChunked
Get a mask of the valid values.
sourceimpl<T> ChunkedArray<T> where
T: PolarsDataType,
impl<T> ChunkedArray<T> where
T: PolarsDataType,
sourcepub fn from_chunks(name: &str, chunks: Vec<ArrayRef>) -> Self
pub fn from_chunks(name: &str, chunks: Vec<ArrayRef>) -> Self
Create a new ChunkedArray from existing chunks.
sourceimpl<T> ChunkedArray<T> where
T: PolarsNumericType,
impl<T> ChunkedArray<T> where
T: PolarsNumericType,
sourceimpl<T> ChunkedArray<T> where
T: PolarsNumericType,
impl<T> ChunkedArray<T> where
T: PolarsNumericType,
sourcepub fn data_views(
&self
) -> impl Iterator<Item = &[T::Native]> + DoubleEndedIterator
pub fn data_views(
&self
) -> impl Iterator<Item = &[T::Native]> + DoubleEndedIterator
Get slices of the underlying arrow data. NOTE: null values should be taken into account by the user of these slices as they are handled separately
pub fn into_no_null_iter(
&self
) -> impl Iterator<Item = T::Native> + '_ + Send + Sync + ExactSizeIterator + DoubleEndedIterator + TrustedLen
sourceimpl ChunkedArray<ListType>
impl ChunkedArray<ListType>
sourcepub fn inner_dtype(&self) -> DataType
pub fn inner_dtype(&self) -> DataType
Get the inner data type of the list.
sourceimpl<T: PolarsNumericType> ChunkedArray<T>
impl<T: PolarsNumericType> ChunkedArray<T>
sourceimpl<T> ChunkedArray<T> where
T: PolarsNumericType,
ChunkedArray<T>: IntoSeries,
impl<T> ChunkedArray<T> where
T: PolarsNumericType,
ChunkedArray<T>: IntoSeries,
We cannot override the left hand side behaviour. So we create a trait LhsNumOps. This allows for 1.add(&Series)
Trait Implementations
sourceimpl<T> Add<&'_ ChunkedArray<T>> for &ChunkedArray<T> where
T: PolarsNumericType,
impl<T> Add<&'_ ChunkedArray<T>> for &ChunkedArray<T> where
T: PolarsNumericType,
sourceimpl Add<&'_ ChunkedArray<Utf8Type>> for &Utf8Chunked
impl Add<&'_ ChunkedArray<Utf8Type>> for &Utf8Chunked
sourceimpl<T> Add<ChunkedArray<T>> for ChunkedArray<T> where
T: PolarsNumericType,
impl<T> Add<ChunkedArray<T>> for ChunkedArray<T> where
T: PolarsNumericType,
sourceimpl Add<ChunkedArray<Utf8Type>> for Utf8Chunked
impl Add<ChunkedArray<Utf8Type>> for Utf8Chunked
sourceimpl<T, N> Add<N> for &ChunkedArray<T> where
T: PolarsNumericType,
N: Num + ToPrimitive,
impl<T, N> Add<N> for &ChunkedArray<T> where
T: PolarsNumericType,
N: Num + ToPrimitive,
sourceimpl<T, N> Add<N> for ChunkedArray<T> where
T: PolarsNumericType,
N: Num + ToPrimitive,
impl<T, N> Add<N> for ChunkedArray<T> where
T: PolarsNumericType,
N: Num + ToPrimitive,
sourceimpl<T> AggList for ChunkedArray<T> where
T: PolarsNumericType,
ChunkedArray<T>: IntoSeries,
impl<T> AggList for ChunkedArray<T> where
T: PolarsNumericType,
ChunkedArray<T>: IntoSeries,
sourceunsafe fn agg_list(&self, groups: &GroupsProxy) -> Series
unsafe fn agg_list(&self, groups: &GroupsProxy) -> Series
Safety Read more
sourceimpl<T> ArgAgg for ChunkedArray<T> where
T: PolarsNumericType,
impl<T> ArgAgg for ChunkedArray<T> where
T: PolarsNumericType,
sourceimpl<'a, T> AsMut<ChunkedArray<T>> for dyn SeriesTrait + 'a where
T: 'static + PolarsDataType,
impl<'a, T> AsMut<ChunkedArray<T>> for dyn SeriesTrait + 'a where
T: 'static + PolarsDataType,
sourcefn as_mut(&mut self) -> &mut ChunkedArray<T>
fn as_mut(&mut self) -> &mut ChunkedArray<T>
Converts this type into a mutable reference of the (usually inferred) input type.
sourceimpl<T> AsRef<ChunkedArray<T>> for ChunkedArray<T>
impl<T> AsRef<ChunkedArray<T>> for ChunkedArray<T>
sourcefn as_ref(&self) -> &ChunkedArray<T>
fn as_ref(&self) -> &ChunkedArray<T>
Converts this type into a shared reference of the (usually inferred) input type.
sourceimpl<'a, T> AsRef<ChunkedArray<T>> for dyn SeriesTrait + 'a where
T: 'static + PolarsDataType,
impl<'a, T> AsRef<ChunkedArray<T>> for dyn SeriesTrait + 'a where
T: 'static + PolarsDataType,
sourcefn as_ref(&self) -> &ChunkedArray<T>
fn as_ref(&self) -> &ChunkedArray<T>
Converts this type into a shared reference of the (usually inferred) input type.
sourceimpl BitAnd<&'_ ChunkedArray<BooleanType>> for &BooleanChunked
impl BitAnd<&'_ ChunkedArray<BooleanType>> for &BooleanChunked
type Output = ChunkedArray<BooleanType>
type Output = ChunkedArray<BooleanType>
The resulting type after applying the &
operator.
sourceimpl BitAnd<&'_ ChunkedArray<Float32Type>> for &Float32Chunked
impl BitAnd<&'_ ChunkedArray<Float32Type>> for &Float32Chunked
type Output = ChunkedArray<Float32Type>
type Output = ChunkedArray<Float32Type>
The resulting type after applying the &
operator.
sourceimpl BitAnd<&'_ ChunkedArray<Float64Type>> for &Float64Chunked
impl BitAnd<&'_ ChunkedArray<Float64Type>> for &Float64Chunked
type Output = ChunkedArray<Float64Type>
type Output = ChunkedArray<Float64Type>
The resulting type after applying the &
operator.
sourceimpl<T> BitAnd<&'_ ChunkedArray<T>> for &ChunkedArray<T> where
T: PolarsIntegerType,
T::Native: BitAnd<Output = T::Native>,
impl<T> BitAnd<&'_ ChunkedArray<T>> for &ChunkedArray<T> where
T: PolarsIntegerType,
T::Native: BitAnd<Output = T::Native>,
sourceimpl BitAnd<ChunkedArray<BooleanType>> for BooleanChunked
impl BitAnd<ChunkedArray<BooleanType>> for BooleanChunked
type Output = ChunkedArray<BooleanType>
type Output = ChunkedArray<BooleanType>
The resulting type after applying the &
operator.
sourceimpl BitOr<&'_ ChunkedArray<BooleanType>> for &BooleanChunked
impl BitOr<&'_ ChunkedArray<BooleanType>> for &BooleanChunked
type Output = ChunkedArray<BooleanType>
type Output = ChunkedArray<BooleanType>
The resulting type after applying the |
operator.
sourceimpl BitOr<&'_ ChunkedArray<Float32Type>> for &Float32Chunked
impl BitOr<&'_ ChunkedArray<Float32Type>> for &Float32Chunked
type Output = ChunkedArray<Float32Type>
type Output = ChunkedArray<Float32Type>
The resulting type after applying the |
operator.
sourceimpl BitOr<&'_ ChunkedArray<Float64Type>> for &Float64Chunked
impl BitOr<&'_ ChunkedArray<Float64Type>> for &Float64Chunked
type Output = ChunkedArray<Float64Type>
type Output = ChunkedArray<Float64Type>
The resulting type after applying the |
operator.
sourceimpl<T> BitOr<&'_ ChunkedArray<T>> for &ChunkedArray<T> where
T: PolarsIntegerType,
T::Native: BitOr<Output = T::Native>,
impl<T> BitOr<&'_ ChunkedArray<T>> for &ChunkedArray<T> where
T: PolarsIntegerType,
T::Native: BitOr<Output = T::Native>,
sourceimpl BitOr<ChunkedArray<BooleanType>> for BooleanChunked
impl BitOr<ChunkedArray<BooleanType>> for BooleanChunked
type Output = ChunkedArray<BooleanType>
type Output = ChunkedArray<BooleanType>
The resulting type after applying the |
operator.
sourceimpl BitXor<&'_ ChunkedArray<BooleanType>> for &BooleanChunked
impl BitXor<&'_ ChunkedArray<BooleanType>> for &BooleanChunked
type Output = ChunkedArray<BooleanType>
type Output = ChunkedArray<BooleanType>
The resulting type after applying the ^
operator.
sourceimpl BitXor<&'_ ChunkedArray<Float32Type>> for &Float32Chunked
impl BitXor<&'_ ChunkedArray<Float32Type>> for &Float32Chunked
type Output = ChunkedArray<Float32Type>
type Output = ChunkedArray<Float32Type>
The resulting type after applying the ^
operator.
sourceimpl BitXor<&'_ ChunkedArray<Float64Type>> for &Float64Chunked
impl BitXor<&'_ ChunkedArray<Float64Type>> for &Float64Chunked
type Output = ChunkedArray<Float64Type>
type Output = ChunkedArray<Float64Type>
The resulting type after applying the ^
operator.
sourceimpl<T> BitXor<&'_ ChunkedArray<T>> for &ChunkedArray<T> where
T: PolarsIntegerType,
T::Native: BitXor<Output = T::Native>,
impl<T> BitXor<&'_ ChunkedArray<T>> for &ChunkedArray<T> where
T: PolarsIntegerType,
T::Native: BitXor<Output = T::Native>,
sourceimpl BitXor<ChunkedArray<BooleanType>> for BooleanChunked
impl BitXor<ChunkedArray<BooleanType>> for BooleanChunked
type Output = ChunkedArray<BooleanType>
type Output = ChunkedArray<BooleanType>
The resulting type after applying the ^
operator.
sourceimpl<T> ChunkAgg<<T as PolarsNumericType>::Native> for ChunkedArray<T> where
T: PolarsNumericType,
<T::Native as Simd>::Simd: Add<Output = <T::Native as Simd>::Simd> + Sum<T::Native> + SimdOrd<T::Native>,
impl<T> ChunkAgg<<T as PolarsNumericType>::Native> for ChunkedArray<T> where
T: PolarsNumericType,
<T::Native as Simd>::Simd: Add<Output = <T::Native as Simd>::Simd> + Sum<T::Native> + SimdOrd<T::Native>,
sourcefn sum(&self) -> Option<T::Native>
fn sum(&self) -> Option<T::Native>
Aggregate the sum of the ChunkedArray.
Returns None
if the array is empty or only contains null values. Read more
fn min(&self) -> Option<T::Native>
sourceimpl<T> ChunkAggSeries for ChunkedArray<T> where
T: PolarsNumericType,
<T::Native as Simd>::Simd: Add<Output = <T::Native as Simd>::Simd> + Sum<T::Native> + SimdOrd<T::Native>,
ChunkedArray<T>: IntoSeries,
impl<T> ChunkAggSeries for ChunkedArray<T> where
T: PolarsNumericType,
<T::Native as Simd>::Simd: Add<Output = <T::Native as Simd>::Simd> + Sum<T::Native> + SimdOrd<T::Native>,
ChunkedArray<T>: IntoSeries,
sourcefn sum_as_series(&self) -> Series
fn sum_as_series(&self) -> Series
Get the sum of the ChunkedArray as a new Series of length 1.
sourcefn max_as_series(&self) -> Series
fn max_as_series(&self) -> Series
Get the max of the ChunkedArray as a new Series of length 1.
sourcefn min_as_series(&self) -> Series
fn min_as_series(&self) -> Series
Get the min of the ChunkedArray as a new Series of length 1.
sourcefn prod_as_series(&self) -> Series
fn prod_as_series(&self) -> Series
Get the product of the ChunkedArray as a new Series of length 1.
sourceimpl<T> ChunkAnyValue for ChunkedArray<T> where
T: PolarsNumericType,
impl<T> ChunkAnyValue for ChunkedArray<T> where
T: PolarsNumericType,
sourceunsafe fn get_any_value_unchecked(&self, index: usize) -> AnyValue<'_>
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
sourcefn get_any_value(&self, index: usize) -> AnyValue<'_>
fn get_any_value(&self, index: usize) -> AnyValue<'_>
Get a single value. Beware this is slow.
sourceimpl<'a, T> ChunkApply<'a, <T as PolarsNumericType>::Native, <T as PolarsNumericType>::Native> for ChunkedArray<T> where
T: PolarsNumericType,
impl<'a, T> ChunkApply<'a, <T as PolarsNumericType>::Native, <T as PolarsNumericType>::Native> for ChunkedArray<T> where
T: PolarsNumericType,
sourcefn apply_cast_numeric<F, S>(&self, f: F) -> ChunkedArray<S> where
F: Fn(T::Native) -> S::Native + Copy,
S: PolarsNumericType,
fn apply_cast_numeric<F, S>(&self, f: F) -> ChunkedArray<S> where
F: Fn(T::Native) -> S::Native + Copy,
S: PolarsNumericType,
Apply a closure elementwise and cast to a Numeric ChunkedArray. This is fastest when the null check branching is more expensive than the closure application. Read more
sourcefn branch_apply_cast_numeric_no_null<F, S>(&self, f: F) -> ChunkedArray<S> where
F: Fn(Option<T::Native>) -> S::Native,
S: PolarsNumericType,
fn branch_apply_cast_numeric_no_null<F, S>(&self, f: F) -> ChunkedArray<S> where
F: Fn(Option<T::Native>) -> S::Native,
S: PolarsNumericType,
Apply a closure on optional values and cast to Numeric ChunkedArray without null values.
sourcefn apply<F>(&'a self, f: F) -> Self where
F: Fn(T::Native) -> T::Native + Copy,
fn apply<F>(&'a self, f: F) -> Self where
F: Fn(T::Native) -> T::Native + Copy,
Apply a closure elementwise. This is fastest when the null check branching is more expensive than the closure application. Often it is. Read more
fn try_apply<F>(&'a self, f: F) -> Result<Self> where
F: Fn(T::Native) -> Result<T::Native> + Copy,
sourcefn apply_on_opt<F>(&'a self, f: F) -> Self where
F: Fn(Option<T::Native>) -> Option<T::Native> + Copy,
fn apply_on_opt<F>(&'a self, f: F) -> Self where
F: Fn(Option<T::Native>) -> Option<T::Native> + Copy,
Apply a closure elementwise including null values.
sourcefn apply_with_idx<F>(&'a self, f: F) -> Self where
F: Fn((usize, T::Native)) -> T::Native + Copy,
fn apply_with_idx<F>(&'a self, f: F) -> Self where
F: Fn((usize, T::Native)) -> T::Native + Copy,
Apply a closure elementwise. The closure gets the index of the element as first argument.
sourceimpl<T> ChunkApplyKernel<PrimitiveArray<<T as PolarsNumericType>::Native>> for ChunkedArray<T> where
T: PolarsNumericType,
impl<T> ChunkApplyKernel<PrimitiveArray<<T as PolarsNumericType>::Native>> for ChunkedArray<T> where
T: PolarsNumericType,
sourcefn apply_kernel(
&self,
f: &dyn Fn(&PrimitiveArray<T::Native>) -> ArrayRef
) -> Self
fn apply_kernel(
&self,
f: &dyn Fn(&PrimitiveArray<T::Native>) -> ArrayRef
) -> Self
Apply kernel and return result as a new ChunkedArray.
sourcefn apply_kernel_cast<S>(
&self,
f: &dyn Fn(&PrimitiveArray<T::Native>) -> ArrayRef
) -> ChunkedArray<S> where
S: PolarsDataType,
fn apply_kernel_cast<S>(
&self,
f: &dyn Fn(&PrimitiveArray<T::Native>) -> ArrayRef
) -> ChunkedArray<S> where
S: PolarsDataType,
Apply a kernel that outputs an array of different type.
sourceimpl<T> ChunkCast for ChunkedArray<T> where
T: PolarsNumericType,
impl<T> ChunkCast for ChunkedArray<T> where
T: PolarsNumericType,
sourceimpl ChunkCompare<&'_ ChunkedArray<BooleanType>> for BooleanChunked
impl ChunkCompare<&'_ ChunkedArray<BooleanType>> for BooleanChunked
type Item = ChunkedArray<BooleanType>
sourcefn eq_missing(&self, rhs: &BooleanChunked) -> BooleanChunked
fn eq_missing(&self, rhs: &BooleanChunked) -> BooleanChunked
Check for equality and regard missing values as equal.
sourcefn equal(&self, rhs: &BooleanChunked) -> BooleanChunked
fn equal(&self, rhs: &BooleanChunked) -> BooleanChunked
Check for equality.
sourcefn not_equal(&self, rhs: &BooleanChunked) -> BooleanChunked
fn not_equal(&self, rhs: &BooleanChunked) -> BooleanChunked
Check for inequality.
sourcefn gt(&self, rhs: &BooleanChunked) -> BooleanChunked
fn gt(&self, rhs: &BooleanChunked) -> BooleanChunked
Greater than comparison.
sourcefn gt_eq(&self, rhs: &BooleanChunked) -> BooleanChunked
fn gt_eq(&self, rhs: &BooleanChunked) -> BooleanChunked
Greater than or equal comparison.
sourcefn lt(&self, rhs: &BooleanChunked) -> BooleanChunked
fn lt(&self, rhs: &BooleanChunked) -> BooleanChunked
Less than comparison.
sourcefn lt_eq(&self, rhs: &BooleanChunked) -> BooleanChunked
fn lt_eq(&self, rhs: &BooleanChunked) -> BooleanChunked
Less than or equal comparison
sourceimpl ChunkCompare<&'_ ChunkedArray<ListType>> for ListChunked
impl ChunkCompare<&'_ ChunkedArray<ListType>> for ListChunked
type Item = ChunkedArray<BooleanType>
sourcefn eq_missing(&self, rhs: &ListChunked) -> BooleanChunked
fn eq_missing(&self, rhs: &ListChunked) -> BooleanChunked
Check for equality and regard missing values as equal.
sourcefn equal(&self, rhs: &ListChunked) -> BooleanChunked
fn equal(&self, rhs: &ListChunked) -> BooleanChunked
Check for equality.
sourcefn not_equal(&self, rhs: &ListChunked) -> BooleanChunked
fn not_equal(&self, rhs: &ListChunked) -> BooleanChunked
Check for inequality.
sourcefn gt(&self, _rhs: &ListChunked) -> BooleanChunked
fn gt(&self, _rhs: &ListChunked) -> BooleanChunked
Greater than comparison.
sourcefn gt_eq(&self, _rhs: &ListChunked) -> BooleanChunked
fn gt_eq(&self, _rhs: &ListChunked) -> BooleanChunked
Greater than or equal comparison.
sourcefn lt(&self, _rhs: &ListChunked) -> BooleanChunked
fn lt(&self, _rhs: &ListChunked) -> BooleanChunked
Less than comparison.
sourcefn lt_eq(&self, _rhs: &ListChunked) -> BooleanChunked
fn lt_eq(&self, _rhs: &ListChunked) -> BooleanChunked
Less than or equal comparison
sourceimpl<T> ChunkCompare<&'_ ChunkedArray<T>> for ChunkedArray<T> where
T: PolarsNumericType,
impl<T> ChunkCompare<&'_ ChunkedArray<T>> for ChunkedArray<T> where
T: PolarsNumericType,
type Item = ChunkedArray<BooleanType>
sourcefn eq_missing(&self, rhs: &ChunkedArray<T>) -> BooleanChunked
fn eq_missing(&self, rhs: &ChunkedArray<T>) -> BooleanChunked
Check for equality and regard missing values as equal.
sourcefn equal(&self, rhs: &ChunkedArray<T>) -> BooleanChunked
fn equal(&self, rhs: &ChunkedArray<T>) -> BooleanChunked
Check for equality.
sourcefn not_equal(&self, rhs: &ChunkedArray<T>) -> BooleanChunked
fn not_equal(&self, rhs: &ChunkedArray<T>) -> BooleanChunked
Check for inequality.
sourcefn gt(&self, rhs: &ChunkedArray<T>) -> BooleanChunked
fn gt(&self, rhs: &ChunkedArray<T>) -> BooleanChunked
Greater than comparison.
sourcefn gt_eq(&self, rhs: &ChunkedArray<T>) -> BooleanChunked
fn gt_eq(&self, rhs: &ChunkedArray<T>) -> BooleanChunked
Greater than or equal comparison.
sourcefn lt(&self, rhs: &ChunkedArray<T>) -> BooleanChunked
fn lt(&self, rhs: &ChunkedArray<T>) -> BooleanChunked
Less than comparison.
sourcefn lt_eq(&self, rhs: &ChunkedArray<T>) -> BooleanChunked
fn lt_eq(&self, rhs: &ChunkedArray<T>) -> BooleanChunked
Less than or equal comparison
sourceimpl ChunkCompare<&'_ ChunkedArray<Utf8Type>> for Utf8Chunked
impl ChunkCompare<&'_ ChunkedArray<Utf8Type>> for Utf8Chunked
type Item = ChunkedArray<BooleanType>
sourcefn eq_missing(&self, rhs: &Utf8Chunked) -> BooleanChunked
fn eq_missing(&self, rhs: &Utf8Chunked) -> BooleanChunked
Check for equality and regard missing values as equal.
sourcefn equal(&self, rhs: &Utf8Chunked) -> BooleanChunked
fn equal(&self, rhs: &Utf8Chunked) -> BooleanChunked
Check for equality.
sourcefn not_equal(&self, rhs: &Utf8Chunked) -> BooleanChunked
fn not_equal(&self, rhs: &Utf8Chunked) -> BooleanChunked
Check for inequality.
sourcefn gt(&self, rhs: &Utf8Chunked) -> BooleanChunked
fn gt(&self, rhs: &Utf8Chunked) -> BooleanChunked
Greater than comparison.
sourcefn gt_eq(&self, rhs: &Utf8Chunked) -> BooleanChunked
fn gt_eq(&self, rhs: &Utf8Chunked) -> BooleanChunked
Greater than or equal comparison.
sourcefn lt(&self, rhs: &Utf8Chunked) -> BooleanChunked
fn lt(&self, rhs: &Utf8Chunked) -> BooleanChunked
Less than comparison.
sourcefn lt_eq(&self, rhs: &Utf8Chunked) -> BooleanChunked
fn lt_eq(&self, rhs: &Utf8Chunked) -> BooleanChunked
Less than or equal comparison
sourceimpl<T, Rhs> ChunkCompare<Rhs> for ChunkedArray<T> where
T: PolarsNumericType,
Rhs: ToPrimitive,
impl<T, Rhs> ChunkCompare<Rhs> for ChunkedArray<T> where
T: PolarsNumericType,
Rhs: ToPrimitive,
type Item = ChunkedArray<BooleanType>
sourcefn eq_missing(&self, rhs: Rhs) -> BooleanChunked
fn eq_missing(&self, rhs: Rhs) -> BooleanChunked
Check for equality and regard missing values as equal.
sourcefn equal(&self, rhs: Rhs) -> BooleanChunked
fn equal(&self, rhs: Rhs) -> BooleanChunked
Check for equality.
sourcefn not_equal(&self, rhs: Rhs) -> BooleanChunked
fn not_equal(&self, rhs: Rhs) -> BooleanChunked
Check for inequality.
sourcefn gt(&self, rhs: Rhs) -> BooleanChunked
fn gt(&self, rhs: Rhs) -> BooleanChunked
Greater than comparison.
sourcefn gt_eq(&self, rhs: Rhs) -> BooleanChunked
fn gt_eq(&self, rhs: Rhs) -> BooleanChunked
Greater than or equal comparison.
sourcefn lt(&self, rhs: Rhs) -> BooleanChunked
fn lt(&self, rhs: Rhs) -> BooleanChunked
Less than comparison.
sourcefn lt_eq(&self, rhs: Rhs) -> BooleanChunked
fn lt_eq(&self, rhs: Rhs) -> BooleanChunked
Less than or equal comparison
sourceimpl<T> ChunkCumAgg<T> for ChunkedArray<T> where
T: PolarsNumericType,
ChunkedArray<T>: FromIterator<Option<T::Native>>,
impl<T> ChunkCumAgg<T> for ChunkedArray<T> where
T: PolarsNumericType,
ChunkedArray<T>: FromIterator<Option<T::Native>>,
sourcefn cummax(&self, reverse: bool) -> ChunkedArray<T>
fn cummax(&self, reverse: bool) -> ChunkedArray<T>
Get an array with the cumulative max computed at every element
sourcefn cummin(&self, reverse: bool) -> ChunkedArray<T>
fn cummin(&self, reverse: bool) -> ChunkedArray<T>
Get an array with the cumulative min computed at every element
sourcefn cumsum(&self, reverse: bool) -> ChunkedArray<T>
fn cumsum(&self, reverse: bool) -> ChunkedArray<T>
Get an array with the cumulative sum computed at every element
sourcefn cumprod(&self, reverse: bool) -> ChunkedArray<T>
fn cumprod(&self, reverse: bool) -> ChunkedArray<T>
Get an array with the cumulative product computed at every element
sourceimpl<T> ChunkExpandAtIndex<T> for ChunkedArray<T> where
ChunkedArray<T>: ChunkFull<T::Native> + TakeRandom<Item = T::Native>,
T: PolarsNumericType,
impl<T> ChunkExpandAtIndex<T> for ChunkedArray<T> where
ChunkedArray<T>: ChunkFull<T::Native> + TakeRandom<Item = T::Native>,
T: PolarsNumericType,
sourcefn expand_at_index(&self, index: usize, length: usize) -> ChunkedArray<T>
fn expand_at_index(&self, index: usize, length: usize) -> ChunkedArray<T>
Create a new ChunkedArray filled with values at that index.
sourceimpl<T> ChunkFillNull for ChunkedArray<T> where
T: PolarsNumericType,
<T::Native as Simd>::Simd: Add<Output = <T::Native as Simd>::Simd> + Sum<T::Native> + SimdOrd<T::Native>,
impl<T> ChunkFillNull for ChunkedArray<T> where
T: PolarsNumericType,
<T::Native as Simd>::Simd: Add<Output = <T::Native as Simd>::Simd> + Sum<T::Native> + SimdOrd<T::Native>,
sourcefn fill_null(&self, strategy: FillNullStrategy) -> Result<Self>
fn fill_null(&self, strategy: FillNullStrategy) -> Result<Self>
Replace None values with one of the following strategies: Read more
sourceimpl<T> ChunkFillNullValue<<T as PolarsNumericType>::Native> for ChunkedArray<T> where
T: PolarsNumericType,
impl<T> ChunkFillNullValue<<T as PolarsNumericType>::Native> for ChunkedArray<T> where
T: PolarsNumericType,
sourcefn fill_null_with_values(&self, value: T::Native) -> Result<Self>
fn fill_null_with_values(&self, value: T::Native) -> Result<Self>
Replace None values with a give value T
.
sourceimpl<T> ChunkFilter<T> for ChunkedArray<T> where
T: PolarsNumericType,
impl<T> ChunkFilter<T> for ChunkedArray<T> where
T: PolarsNumericType,
sourcefn filter(&self, filter: &BooleanChunked) -> Result<ChunkedArray<T>>
fn filter(&self, filter: &BooleanChunked) -> Result<ChunkedArray<T>>
Filter values in the ChunkedArray with a boolean mask. Read more
sourceimpl<T> ChunkFull<<T as PolarsNumericType>::Native> for ChunkedArray<T> where
T: PolarsNumericType,
impl<T> ChunkFull<<T as PolarsNumericType>::Native> for ChunkedArray<T> where
T: PolarsNumericType,
sourceimpl<T> ChunkFullNull for ChunkedArray<T> where
T: PolarsNumericType,
impl<T> ChunkFullNull for ChunkedArray<T> where
T: PolarsNumericType,
sourceimpl<T> ChunkLen for ChunkedArray<T>
impl<T> ChunkLen for ChunkedArray<T>
sourceimpl<T> ChunkOps for ChunkedArray<T> where
T: PolarsNumericType,
impl<T> ChunkOps for ChunkedArray<T> where
T: PolarsNumericType,
sourceimpl<T> ChunkPeaks for ChunkedArray<T> where
T: PolarsNumericType,
impl<T> ChunkPeaks for ChunkedArray<T> where
T: PolarsNumericType,
sourcefn peak_max(&self) -> BooleanChunked
fn peak_max(&self) -> BooleanChunked
Get a boolean mask of the local maximum peaks.
sourcefn peak_min(&self) -> BooleanChunked
fn peak_min(&self) -> BooleanChunked
Get a boolean mask of the local minimum peaks.
sourceimpl<T> ChunkQuantile<f64> for ChunkedArray<T> where
T: PolarsIntegerType,
T::Native: Ord,
<T::Native as Simd>::Simd: Add<Output = <T::Native as Simd>::Simd> + Sum<T::Native> + SimdOrd<T::Native>,
impl<T> ChunkQuantile<f64> for ChunkedArray<T> where
T: PolarsIntegerType,
T::Native: Ord,
<T::Native as Simd>::Simd: Add<Output = <T::Native as Simd>::Simd> + Sum<T::Native> + SimdOrd<T::Native>,
sourceimpl<T> ChunkReverse<T> for ChunkedArray<T> where
T: PolarsNumericType,
ChunkedArray<T>: ChunkOps,
impl<T> ChunkReverse<T> for ChunkedArray<T> where
T: PolarsNumericType,
ChunkedArray<T>: ChunkOps,
sourcefn reverse(&self) -> ChunkedArray<T>
fn reverse(&self) -> ChunkedArray<T>
Return a reversed version of this array.
sourceimpl<T> ChunkRollApply for ChunkedArray<T> where
T: PolarsNumericType,
Self: IntoSeries,
impl<T> ChunkRollApply for ChunkedArray<T> where
T: PolarsNumericType,
Self: IntoSeries,
sourcefn rolling_apply(
&self,
f: &dyn Fn(&Series) -> Series,
options: RollingOptionsFixedWindow
) -> Result<Series>
fn rolling_apply(
&self,
f: &dyn Fn(&Series) -> Series,
options: RollingOptionsFixedWindow
) -> Result<Series>
Apply a rolling custom function. This is pretty slow because of dynamic dispatch.
sourceimpl<'a, T> ChunkSet<'a, <T as PolarsNumericType>::Native, <T as PolarsNumericType>::Native> for ChunkedArray<T> where
T: PolarsNumericType,
impl<'a, T> ChunkSet<'a, <T as PolarsNumericType>::Native, <T as PolarsNumericType>::Native> for ChunkedArray<T> where
T: PolarsNumericType,
sourcefn set_at_idx<I: IntoIterator<Item = usize>>(
&'a self,
idx: I,
value: Option<T::Native>
) -> Result<Self>
fn set_at_idx<I: IntoIterator<Item = usize>>(
&'a self,
idx: I,
value: Option<T::Native>
) -> Result<Self>
Set the values at indexes idx
to some optional value Option<T>
. Read more
sourcefn set_at_idx_with<I: IntoIterator<Item = usize>, F>(
&'a self,
idx: I,
f: F
) -> Result<Self> where
F: Fn(Option<T::Native>) -> Option<T::Native>,
fn set_at_idx_with<I: IntoIterator<Item = usize>, F>(
&'a self,
idx: I,
f: F
) -> Result<Self> where
F: Fn(Option<T::Native>) -> Option<T::Native>,
Set the values at indexes idx
by applying a closure to these values. Read more
sourceimpl<T> ChunkShift<T> for ChunkedArray<T> where
T: PolarsNumericType,
impl<T> ChunkShift<T> for ChunkedArray<T> where
T: PolarsNumericType,
fn shift(&self, periods: i64) -> ChunkedArray<T>
sourceimpl<T> ChunkShiftFill<T, Option<<T as PolarsNumericType>::Native>> for ChunkedArray<T> where
T: PolarsNumericType,
impl<T> ChunkShiftFill<T, Option<<T as PolarsNumericType>::Native>> for ChunkedArray<T> where
T: PolarsNumericType,
sourcefn shift_and_fill(
&self,
periods: i64,
fill_value: Option<T::Native>
) -> ChunkedArray<T>
fn shift_and_fill(
&self,
periods: i64,
fill_value: Option<T::Native>
) -> ChunkedArray<T>
Shift the values by a given period and fill the parts that will be empty due to this operation
with fill_value
. Read more
sourceimpl<T> ChunkSort<T> for ChunkedArray<T> where
T: PolarsIntegerType,
T::Native: Default + Ord,
impl<T> ChunkSort<T> for ChunkedArray<T> where
T: PolarsIntegerType,
T::Native: Default + Ord,
sourcefn argsort_multiple(&self, other: &[Series], reverse: &[bool]) -> Result<IdxCa>
fn argsort_multiple(&self, other: &[Series], reverse: &[bool]) -> Result<IdxCa>
Panics
This function is very opinionated.
We assume that all numeric Series
are of the same type, if not it will panic
fn sort_with(&self, options: SortOptions) -> ChunkedArray<T>
sourcefn sort(&self, reverse: bool) -> ChunkedArray<T>
fn sort(&self, reverse: bool) -> ChunkedArray<T>
Returned a sorted ChunkedArray
.
sourcefn argsort(&self, options: SortOptions) -> IdxCa
fn argsort(&self, options: SortOptions) -> IdxCa
Retrieve the indexes needed to sort this array.
sourceimpl<T> ChunkTake for ChunkedArray<T> where
T: PolarsNumericType,
impl<T> ChunkTake for ChunkedArray<T> where
T: PolarsNumericType,
sourceunsafe fn take_unchecked<I, INulls>(
&self,
indices: TakeIdx<'_, I, INulls>
) -> Self where
Self: Sized,
I: TakeIterator,
INulls: TakeIteratorNulls,
unsafe fn take_unchecked<I, INulls>(
&self,
indices: TakeIdx<'_, I, INulls>
) -> Self where
Self: Sized,
I: TakeIterator,
INulls: TakeIteratorNulls,
Take values from ChunkedArray by index. Read more
sourcefn take<I, INulls>(&self, indices: TakeIdx<'_, I, INulls>) -> Result<Self> where
Self: Sized,
I: TakeIterator,
INulls: TakeIteratorNulls,
fn take<I, INulls>(&self, indices: TakeIdx<'_, I, INulls>) -> Result<Self> where
Self: Sized,
I: TakeIterator,
INulls: TakeIteratorNulls,
Take values from ChunkedArray by index. Note that the iterator will be cloned, so prefer an iterator that takes the owned memory by reference. Read more
sourceimpl<T> ChunkTakeEvery<T> for ChunkedArray<T> where
T: PolarsNumericType,
impl<T> ChunkTakeEvery<T> for ChunkedArray<T> where
T: PolarsNumericType,
sourcefn take_every(&self, n: usize) -> ChunkedArray<T>
fn take_every(&self, n: usize) -> ChunkedArray<T>
Traverse and collect every nth element in a new array.
sourceimpl<T> ChunkUnique<T> for ChunkedArray<T> where
T: PolarsIntegerType,
T::Native: Hash + Eq,
ChunkedArray<T>: ChunkOps + IntoSeries,
impl<T> ChunkUnique<T> for ChunkedArray<T> where
T: PolarsIntegerType,
T::Native: Hash + Eq,
ChunkedArray<T>: ChunkOps + IntoSeries,
sourcefn arg_unique(&self) -> Result<IdxCa>
fn arg_unique(&self) -> Result<IdxCa>
Get first index of the unique values in a ChunkedArray
.
This Vec is sorted. Read more
sourcefn is_unique(&self) -> Result<BooleanChunked>
fn is_unique(&self) -> Result<BooleanChunked>
Get a mask of all the unique values.
sourcefn is_duplicated(&self) -> Result<BooleanChunked>
fn is_duplicated(&self) -> Result<BooleanChunked>
Get a mask of all the duplicated values.
sourceimpl<T> ChunkVar<f64> for ChunkedArray<T> where
T: PolarsIntegerType,
<T::Native as Simd>::Simd: Add<Output = <T::Native as Simd>::Simd> + Sum<T::Native> + SimdOrd<T::Native>,
impl<T> ChunkVar<f64> for ChunkedArray<T> where
T: PolarsIntegerType,
<T::Native as Simd>::Simd: Add<Output = <T::Native as Simd>::Simd> + Sum<T::Native> + SimdOrd<T::Native>,
sourceimpl<T> ChunkZip<T> for ChunkedArray<T> where
T: PolarsNumericType,
impl<T> ChunkZip<T> for ChunkedArray<T> where
T: PolarsNumericType,
sourcefn zip_with(
&self,
mask: &BooleanChunked,
other: &ChunkedArray<T>
) -> Result<ChunkedArray<T>>
fn zip_with(
&self,
mask: &BooleanChunked,
other: &ChunkedArray<T>
) -> Result<ChunkedArray<T>>
Create a new ChunkedArray with values from self where the mask evaluates true
and values
from other
where the mask evaluates false
Read more
sourceimpl<T> Clone for ChunkedArray<T>
impl<T> Clone for ChunkedArray<T>
sourceimpl<T> Debug for ChunkedArray<T> where
T: PolarsNumericType,
impl<T> Debug for ChunkedArray<T> where
T: PolarsNumericType,
sourceimpl Debug for ChunkedArray<BooleanType>
impl Debug for ChunkedArray<BooleanType>
sourceimpl<T> Default for ChunkedArray<T>
impl<T> Default for ChunkedArray<T>
sourceimpl<T> Div<&'_ ChunkedArray<T>> for &ChunkedArray<T> where
T: PolarsNumericType,
impl<T> Div<&'_ ChunkedArray<T>> for &ChunkedArray<T> where
T: PolarsNumericType,
sourceimpl<T> Div<ChunkedArray<T>> for ChunkedArray<T> where
T: PolarsNumericType,
impl<T> Div<ChunkedArray<T>> for ChunkedArray<T> where
T: PolarsNumericType,
sourceimpl<T, N> Div<N> for &ChunkedArray<T> where
T: PolarsNumericType,
N: Num + ToPrimitive,
impl<T, N> Div<N> for &ChunkedArray<T> where
T: PolarsNumericType,
N: Num + ToPrimitive,
sourceimpl<T, N> Div<N> for ChunkedArray<T> where
T: PolarsNumericType,
N: Num + ToPrimitive,
impl<T, N> Div<N> for ChunkedArray<T> where
T: PolarsNumericType,
N: Num + ToPrimitive,
sourceimpl<T> Drop for ChunkedArray<T>
impl<T> Drop for ChunkedArray<T>
sourceimpl<T: PolarsNumericType> From<&'_ [<T as PolarsNumericType>::Native]> for ChunkedArray<T>
impl<T: PolarsNumericType> From<&'_ [<T as PolarsNumericType>::Native]> for ChunkedArray<T>
sourceimpl<'a> From<&'a ChunkedArray<BooleanType>> for Vec<Option<bool>>
impl<'a> From<&'a ChunkedArray<BooleanType>> for Vec<Option<bool>>
sourcefn from(ca: &'a BooleanChunked) -> Self
fn from(ca: &'a BooleanChunked) -> Self
Converts to this type from the input type.
sourceimpl<'a, T> From<&'a ChunkedArray<T>> for Vec<Option<T::Native>> where
T: PolarsNumericType,
impl<'a, T> From<&'a ChunkedArray<T>> for Vec<Option<T::Native>> where
T: PolarsNumericType,
sourcefn from(ca: &'a ChunkedArray<T>) -> Self
fn from(ca: &'a ChunkedArray<T>) -> Self
Converts to this type from the input type.
sourceimpl<'a> From<&'a ChunkedArray<UInt32Type>> for TakeIdx<'a, Dummy<usize>, Dummy<Option<usize>>>
impl<'a> From<&'a ChunkedArray<UInt32Type>> for TakeIdx<'a, Dummy<usize>, Dummy<Option<usize>>>
Conversion from UInt32Chunked to Unchecked TakeIdx
sourceimpl<'a> From<&'a ChunkedArray<Utf8Type>> for Vec<Option<&'a str>>
impl<'a> From<&'a ChunkedArray<Utf8Type>> for Vec<Option<&'a str>>
From trait
sourcefn from(ca: &'a Utf8Chunked) -> Self
fn from(ca: &'a Utf8Chunked) -> Self
Converts to this type from the input type.
sourceimpl<T: PolarsNumericType> From<(&'_ str, PrimitiveArray<<T as PolarsNumericType>::Native>)> for ChunkedArray<T>
impl<T: PolarsNumericType> From<(&'_ str, PrimitiveArray<<T as PolarsNumericType>::Native>)> for ChunkedArray<T>
sourceimpl From<ChunkedArray<BooleanType>> for Vec<Option<bool>>
impl From<ChunkedArray<BooleanType>> for Vec<Option<bool>>
sourcefn from(ca: BooleanChunked) -> Self
fn from(ca: BooleanChunked) -> Self
Converts to this type from the input type.
sourceimpl<T> From<ChunkedArray<T>> for Series where
T: PolarsDataType,
ChunkedArray<T>: IntoSeries,
impl<T> From<ChunkedArray<T>> for Series where
T: PolarsDataType,
ChunkedArray<T>: IntoSeries,
sourcefn from(ca: ChunkedArray<T>) -> Self
fn from(ca: ChunkedArray<T>) -> Self
Converts to this type from the input type.
sourceimpl From<ChunkedArray<Utf8Type>> for Vec<Option<String>>
impl From<ChunkedArray<Utf8Type>> for Vec<Option<String>>
sourcefn from(ca: Utf8Chunked) -> Self
fn from(ca: Utf8Chunked) -> Self
Converts to this type from the input type.
sourceimpl<T: PolarsNumericType> From<PrimitiveArray<<T as PolarsNumericType>::Native>> for ChunkedArray<T>
impl<T: PolarsNumericType> From<PrimitiveArray<<T as PolarsNumericType>::Native>> for ChunkedArray<T>
sourcefn from(a: PrimitiveArray<T::Native>) -> Self
fn from(a: PrimitiveArray<T::Native>) -> Self
Converts to this type from the input type.
sourceimpl<T> FromIterator<(Vec<<T as PolarsNumericType>::Native, Global>, Option<Bitmap>)> for ChunkedArray<T> where
T: PolarsNumericType,
impl<T> FromIterator<(Vec<<T as PolarsNumericType>::Native, Global>, Option<Bitmap>)> for ChunkedArray<T> where
T: PolarsNumericType,
sourceimpl<T> FromIterator<Option<<T as PolarsNumericType>::Native>> for ChunkedArray<T> where
T: PolarsNumericType,
impl<T> FromIterator<Option<<T as PolarsNumericType>::Native>> for ChunkedArray<T> where
T: PolarsNumericType,
FromIterator trait
sourceimpl FromIterator<Option<bool>> for ChunkedArray<BooleanType>
impl FromIterator<Option<bool>> for ChunkedArray<BooleanType>
sourceimpl<T> FromIteratorReversed<Option<<T as PolarsNumericType>::Native>> for ChunkedArray<T> where
T: PolarsNumericType,
impl<T> FromIteratorReversed<Option<<T as PolarsNumericType>::Native>> for ChunkedArray<T> where
T: PolarsNumericType,
fn from_trusted_len_iter_rev<I: TrustedLen<Item = Option<T::Native>>>(
iter: I
) -> Self
sourceimpl<T> FromParallelIterator<Option<<T as PolarsNumericType>::Native>> for ChunkedArray<T> where
T: PolarsNumericType,
impl<T> FromParallelIterator<Option<<T as PolarsNumericType>::Native>> for ChunkedArray<T> where
T: PolarsNumericType,
sourcefn from_par_iter<I: IntoParallelIterator<Item = Option<T::Native>>>(
iter: I
) -> Self
fn from_par_iter<I: IntoParallelIterator<Item = Option<T::Native>>>(
iter: I
) -> Self
Creates an instance of the collection from the parallel iterator par_iter
. Read more
sourceimpl<T> FromTrustedLenIterator<Option<<T as PolarsNumericType>::Native>> for ChunkedArray<T> where
T: PolarsNumericType,
impl<T> FromTrustedLenIterator<Option<<T as PolarsNumericType>::Native>> for ChunkedArray<T> where
T: PolarsNumericType,
fn from_iter_trusted_length<I: IntoIterator<Item = Option<T::Native>>>(
iter: I
) -> Self
sourceimpl FromTrustedLenIterator<Option<bool>> for ChunkedArray<BooleanType>
impl FromTrustedLenIterator<Option<bool>> for ChunkedArray<BooleanType>
fn from_iter_trusted_length<I: IntoIterator<Item = Option<bool>>>(
iter: I
) -> Self where
I::IntoIter: TrustedLen,
sourceimpl Interpolate for ChunkedArray<UInt32Type>
impl Interpolate for ChunkedArray<UInt32Type>
fn interpolate(&self) -> Self
sourceimpl Interpolate for ChunkedArray<UInt64Type>
impl Interpolate for ChunkedArray<UInt64Type>
fn interpolate(&self) -> Self
sourceimpl Interpolate for ChunkedArray<Int32Type>
impl Interpolate for ChunkedArray<Int32Type>
fn interpolate(&self) -> Self
sourceimpl Interpolate for ChunkedArray<Int64Type>
impl Interpolate for ChunkedArray<Int64Type>
fn interpolate(&self) -> Self
sourceimpl Interpolate for ChunkedArray<Float32Type>
impl Interpolate for ChunkedArray<Float32Type>
fn interpolate(&self) -> Self
sourceimpl Interpolate for ChunkedArray<Float64Type>
impl Interpolate for ChunkedArray<Float64Type>
fn interpolate(&self) -> Self
sourceimpl<T> IntoGroupsProxy for ChunkedArray<T> where
T: PolarsNumericType,
T::Native: NumCast,
impl<T> IntoGroupsProxy for ChunkedArray<T> where
T: PolarsNumericType,
T::Native: NumCast,
sourcefn group_tuples(&self, multithreaded: bool, sorted: bool) -> GroupsProxy
fn group_tuples(&self, multithreaded: bool, sorted: bool) -> GroupsProxy
Create the tuples need for a groupby operation. * The first value in the tuple is the first index of the group. * The second value in the tuple is are the indexes of the groups including the first value. Read more
sourceimpl<'a, T> IntoIterator for &'a ChunkedArray<T> where
T: PolarsNumericType,
impl<'a, T> IntoIterator for &'a ChunkedArray<T> where
T: PolarsNumericType,
type Item = Option<<T as PolarsNumericType>::Native>
type Item = Option<<T as PolarsNumericType>::Native>
The type of the elements being iterated over.
type IntoIter = Box<dyn PolarsIterator<Item = <&'a ChunkedArray<T> as IntoIterator>::Item> + 'a, Global>
type IntoIter = Box<dyn PolarsIterator<Item = <&'a ChunkedArray<T> as IntoIterator>::Item> + 'a, Global>
Which kind of iterator are we turning this into?
sourceimpl<'a, T> IntoTakeRandom<'a> for &'a ChunkedArray<T> where
T: PolarsNumericType,
impl<'a, T> IntoTakeRandom<'a> for &'a ChunkedArray<T> where
T: PolarsNumericType,
type Item = <T as PolarsNumericType>::Native
type TakeRandom = TakeRandBranch3<NumTakeRandomCont<'a, <T as PolarsNumericType>::Native>, NumTakeRandomSingleChunk<'a, <T as PolarsNumericType>::Native>, NumTakeRandomChunked<'a, <T as PolarsNumericType>::Native>>
sourcefn take_rand(&self) -> Self::TakeRandom
fn take_rand(&self) -> Self::TakeRandom
Create a type that implements TakeRandom
.
sourceimpl<T> IsFirst<T> for ChunkedArray<T> where
T: PolarsNumericType,
impl<T> IsFirst<T> for ChunkedArray<T> where
T: PolarsNumericType,
sourcefn is_first(&self) -> Result<BooleanChunked>
fn is_first(&self) -> Result<BooleanChunked>
is_first
only.sourceimpl<T> IsIn for ChunkedArray<T> where
T: PolarsNumericType,
impl<T> IsIn for ChunkedArray<T> where
T: PolarsNumericType,
sourcefn is_in(&self, other: &Series) -> Result<BooleanChunked>
fn is_in(&self, other: &Series) -> Result<BooleanChunked>
is_in
only.Check if elements of this array are in the right Series, or List values of the right Series.
sourceimpl<T> Mul<&'_ ChunkedArray<T>> for &ChunkedArray<T> where
T: PolarsNumericType,
impl<T> Mul<&'_ ChunkedArray<T>> for &ChunkedArray<T> where
T: PolarsNumericType,
sourceimpl<T> Mul<ChunkedArray<T>> for ChunkedArray<T> where
T: PolarsNumericType,
impl<T> Mul<ChunkedArray<T>> for ChunkedArray<T> where
T: PolarsNumericType,
sourceimpl<T, N> Mul<N> for &ChunkedArray<T> where
T: PolarsNumericType,
N: Num + ToPrimitive,
impl<T, N> Mul<N> for &ChunkedArray<T> where
T: PolarsNumericType,
N: Num + ToPrimitive,
sourceimpl<T, N> Mul<N> for ChunkedArray<T> where
T: PolarsNumericType,
N: Num + ToPrimitive,
impl<T, N> Mul<N> for ChunkedArray<T> where
T: PolarsNumericType,
N: Num + ToPrimitive,
sourceimpl NamedFrom<Range<u32>, UInt32Type> for ChunkedArray<UInt32Type>
impl NamedFrom<Range<u32>, UInt32Type> for ChunkedArray<UInt32Type>
sourceimpl NamedFrom<Range<u64>, UInt64Type> for ChunkedArray<UInt64Type>
impl NamedFrom<Range<u64>, UInt64Type> for ChunkedArray<UInt64Type>
sourceimpl<T> NewChunkedArray<T, <T as PolarsNumericType>::Native> for ChunkedArray<T> where
T: PolarsNumericType,
impl<T> NewChunkedArray<T, <T as PolarsNumericType>::Native> for ChunkedArray<T> where
T: PolarsNumericType,
sourcefn from_iter_values(
name: &str,
it: impl Iterator<Item = T::Native>
) -> ChunkedArray<T>
fn from_iter_values(
name: &str,
it: impl Iterator<Item = T::Native>
) -> ChunkedArray<T>
Create a new ChunkedArray from an iterator.
fn from_slice(name: &str, v: &[T::Native]) -> Self
fn from_slice_options(name: &str, opt_v: &[Option<T::Native>]) -> Self
sourcefn from_iter_options(
name: &str,
it: impl Iterator<Item = Option<T::Native>>
) -> ChunkedArray<T>
fn from_iter_options(
name: &str,
it: impl Iterator<Item = Option<T::Native>>
) -> ChunkedArray<T>
Create a new ChunkedArray from an iterator.
sourceimpl<T> NumOpsDispatch for ChunkedArray<T> where
T: PolarsNumericType,
ChunkedArray<T>: IntoSeries,
impl<T> NumOpsDispatch for ChunkedArray<T> where
T: PolarsNumericType,
ChunkedArray<T>: IntoSeries,
sourceimpl<T> NumOpsDispatchChecked for ChunkedArray<T> where
T: PolarsIntegerType,
T::Native: CheckedDiv<Output = T::Native> + Zero + One,
ChunkedArray<T>: IntoSeries,
impl<T> NumOpsDispatchChecked for ChunkedArray<T> where
T: PolarsIntegerType,
T::Native: CheckedDiv<Output = T::Native> + Zero + One,
ChunkedArray<T>: IntoSeries,
sourcefn checked_div(&self, rhs: &Series) -> Result<Series>
fn checked_div(&self, rhs: &Series) -> Result<Series>
Checked integer division. Computes self / rhs, returning None if rhs == 0 or the division results in overflow.
fn checked_div_num<T: ToPrimitive>(&self, _rhs: T) -> Result<Series>
sourceimpl<T> Pow for ChunkedArray<T> where
T: PolarsNumericType,
ChunkedArray<T>: ChunkCast,
impl<T> Pow for ChunkedArray<T> where
T: PolarsNumericType,
ChunkedArray<T>: ChunkCast,
fn pow_f32(&self, exp: f32) -> Float32Chunked
fn pow_f64(&self, exp: f64) -> Float64Chunked
sourceimpl<T> QuantileAggSeries for ChunkedArray<T> where
T: PolarsIntegerType,
T::Native: Ord,
<T::Native as Simd>::Simd: Add<Output = <T::Native as Simd>::Simd> + Sum<T::Native> + SimdOrd<T::Native>,
impl<T> QuantileAggSeries for ChunkedArray<T> where
T: PolarsIntegerType,
T::Native: Ord,
<T::Native as Simd>::Simd: Add<Output = <T::Native as Simd>::Simd> + Sum<T::Native> + SimdOrd<T::Native>,
sourcefn quantile_as_series(
&self,
quantile: f64,
interpol: QuantileInterpolOptions
) -> Result<Series>
fn quantile_as_series(
&self,
quantile: f64,
interpol: QuantileInterpolOptions
) -> Result<Series>
Get the quantile of the ChunkedArray as a new Series of length 1.
sourcefn median_as_series(&self) -> Series
fn median_as_series(&self) -> Series
Get the median of the ChunkedArray as a new Series of length 1.
sourceimpl<T> Rem<&'_ ChunkedArray<T>> for &ChunkedArray<T> where
T: PolarsNumericType,
impl<T> Rem<&'_ ChunkedArray<T>> for &ChunkedArray<T> where
T: PolarsNumericType,
sourceimpl<T> Rem<ChunkedArray<T>> for ChunkedArray<T> where
T: PolarsNumericType,
impl<T> Rem<ChunkedArray<T>> for ChunkedArray<T> where
T: PolarsNumericType,
sourceimpl<T, N> Rem<N> for &ChunkedArray<T> where
T: PolarsNumericType,
N: Num + ToPrimitive,
impl<T, N> Rem<N> for &ChunkedArray<T> where
T: PolarsNumericType,
N: Num + ToPrimitive,
sourceimpl<T, N> Rem<N> for ChunkedArray<T> where
T: PolarsNumericType,
N: Num + ToPrimitive,
impl<T, N> Rem<N> for ChunkedArray<T> where
T: PolarsNumericType,
N: Num + ToPrimitive,
sourceimpl<T> RepeatBy for ChunkedArray<T> where
T: PolarsNumericType,
impl<T> RepeatBy for ChunkedArray<T> where
T: PolarsNumericType,
sourcefn repeat_by(&self, by: &IdxCa) -> ListChunked
fn repeat_by(&self, by: &IdxCa) -> ListChunked
repeat_by
only.Repeat the values n
times, where n
is determined by the values in by
.
sourceimpl<T> StrConcat for ChunkedArray<T> where
T: PolarsNumericType,
T::Native: Display,
impl<T> StrConcat for ChunkedArray<T> where
T: PolarsNumericType,
T::Native: Display,
sourcefn str_concat(&self, delimiter: &str) -> Utf8Chunked
fn str_concat(&self, delimiter: &str) -> Utf8Chunked
concat_str
only.Concat the values into a string array. Read more
sourceimpl<T> Sub<&'_ ChunkedArray<T>> for &ChunkedArray<T> where
T: PolarsNumericType,
impl<T> Sub<&'_ ChunkedArray<T>> for &ChunkedArray<T> where
T: PolarsNumericType,
sourceimpl<T> Sub<ChunkedArray<T>> for ChunkedArray<T> where
T: PolarsNumericType,
impl<T> Sub<ChunkedArray<T>> for ChunkedArray<T> where
T: PolarsNumericType,
sourceimpl<T, N> Sub<N> for &ChunkedArray<T> where
T: PolarsNumericType,
N: Num + ToPrimitive,
impl<T, N> Sub<N> for &ChunkedArray<T> where
T: PolarsNumericType,
N: Num + ToPrimitive,
sourceimpl<T, N> Sub<N> for ChunkedArray<T> where
T: PolarsNumericType,
N: Num + ToPrimitive,
impl<T, N> Sub<N> for ChunkedArray<T> where
T: PolarsNumericType,
N: Num + ToPrimitive,
sourceimpl<T> TakeRandom for ChunkedArray<T> where
T: PolarsNumericType,
impl<T> TakeRandom for ChunkedArray<T> where
T: PolarsNumericType,
sourceimpl<'a, T> TakeRandom for &'a ChunkedArray<T> where
T: PolarsNumericType,
impl<'a, T> TakeRandom for &'a ChunkedArray<T> where
T: PolarsNumericType,
sourceimpl<T> VarAggSeries for ChunkedArray<T> where
T: PolarsIntegerType,
<T::Native as Simd>::Simd: Add<Output = <T::Native as Simd>::Simd> + Sum<T::Native> + SimdOrd<T::Native>,
impl<T> VarAggSeries for ChunkedArray<T> where
T: PolarsIntegerType,
<T::Native as Simd>::Simd: Add<Output = <T::Native as Simd>::Simd> + Sum<T::Native> + SimdOrd<T::Native>,
sourcefn var_as_series(&self) -> Series
fn var_as_series(&self) -> Series
Get the variance of the ChunkedArray as a new Series of length 1.
sourcefn std_as_series(&self) -> Series
fn std_as_series(&self) -> Series
Get the standard deviation of the ChunkedArray as a new Series of length 1.
sourceimpl<T> VecHash for ChunkedArray<T> where
T: PolarsIntegerType,
T::Native: Hash + CallHasher,
impl<T> VecHash for ChunkedArray<T> where
T: PolarsIntegerType,
T::Native: Hash + CallHasher,
sourceimpl<T> ZipOuterJoinColumn for ChunkedArray<T> where
T: PolarsIntegerType,
ChunkedArray<T>: IntoSeries,
impl<T> ZipOuterJoinColumn for ChunkedArray<T> where
T: PolarsIntegerType,
ChunkedArray<T>: IntoSeries,
Auto Trait Implementations
impl<T> !RefUnwindSafe for ChunkedArray<T>
impl<T> Send for ChunkedArray<T> where
T: Send,
impl<T> Sync for ChunkedArray<T> where
T: Sync,
impl<T> Unpin for ChunkedArray<T> where
T: Unpin,
impl<T> !UnwindSafe for ChunkedArray<T>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more