Struct polars_core::chunked_array::ChunkedArray
source · pub struct ChunkedArray<T: PolarsDataType> { /* 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_and_cast(ca: &Float32Chunked) -> Float64Chunked {
ca.apply_values_generic(|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) -> PolarsResult<&Int32Chunked>{
series.i32()
}
fn to_series(ca: Int32Chunked) -> Series {
ca.into_series()
}
§Iterators
ChunkedArray
s 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.iter()
.for_each(|opt_v| println!("{:?}", opt_v))
}
fn iter_backward(ca: &Float32Chunked) {
ca.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 ChunkedArray
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 ChunkedArray
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 ChunkedArray::rechunk
after
multiple append operations.
See also ChunkedArray::extend
for appends within a chunk.
§Invariants
- A
ChunkedArray
should always have at least a singleArrayRef
. - The
PolarsDataType
T
should always map to the correctArrowDataType
in theArrayRef
chunks. - Nested datatypes such as
List
and [Array
] store the physical types instead of the logical type given by the datatype.
Implementations§
source§impl ChunkedArray<BooleanType>
impl ChunkedArray<BooleanType>
Booleans are cast to 1 or 0.
source§impl<T> ChunkedArray<T>
impl<T> ChunkedArray<T>
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
source§impl<T> ChunkedArray<T>where
T: PolarsDataType,
impl<T> ChunkedArray<T>where
T: PolarsDataType,
pub fn apply_values_generic<'a, U, K, F>(&'a self, op: F) -> ChunkedArray<U>
sourcepub fn apply_nonnull_values_generic<'a, U, K, F>(
&'a self,
dtype: DataType,
op: F
) -> ChunkedArray<U>where
U: PolarsDataType,
F: FnMut(T::Physical<'a>) -> K,
U::Array: ArrayFromIterDtype<K> + ArrayFromIterDtype<Option<K>>,
pub fn apply_nonnull_values_generic<'a, U, K, F>(
&'a self,
dtype: DataType,
op: F
) -> ChunkedArray<U>where
U: PolarsDataType,
F: FnMut(T::Physical<'a>) -> K,
U::Array: ArrayFromIterDtype<K> + ArrayFromIterDtype<Option<K>>,
Applies a function only to the non-null elements, propagating nulls.
sourcepub fn try_apply_nonnull_values_generic<'a, U, K, F, E>(
&'a self,
op: F
) -> Result<ChunkedArray<U>, E>where
U: PolarsDataType,
F: FnMut(T::Physical<'a>) -> Result<K, E>,
U::Array: ArrayFromIter<K> + ArrayFromIter<Option<K>>,
pub fn try_apply_nonnull_values_generic<'a, U, K, F, E>(
&'a self,
op: F
) -> Result<ChunkedArray<U>, E>where
U: PolarsDataType,
F: FnMut(T::Physical<'a>) -> Result<K, E>,
U::Array: ArrayFromIter<K> + ArrayFromIter<Option<K>>,
Applies a function only to the non-null elements, propagating nulls.
pub fn apply_generic<'a, U, K, F>(&'a self, op: F) -> ChunkedArray<U>where
U: PolarsDataType,
F: FnMut(Option<T::Physical<'a>>) -> Option<K>,
U::Array: ArrayFromIter<Option<K>>,
pub fn try_apply_generic<'a, U, K, F, E>(
&'a self,
op: F
) -> Result<ChunkedArray<U>, E>where
U: PolarsDataType,
F: FnMut(Option<T::Physical<'a>>) -> Result<Option<K>, E> + Copy,
U::Array: ArrayFromIter<Option<K>>,
source§impl<T: PolarsNumericType> ChunkedArray<T>
impl<T: PolarsNumericType> ChunkedArray<T>
sourcepub fn cast_and_apply_in_place<F, S>(&self, f: F) -> ChunkedArray<S>
pub fn cast_and_apply_in_place<F, S>(&self, f: F) -> ChunkedArray<S>
Cast a numeric array to another numeric data type and apply a function in place. This saves an allocation.
source§impl<T: PolarsNumericType> ChunkedArray<T>
impl<T: PolarsNumericType> ChunkedArray<T>
source§impl ChunkedArray<StringType>
impl ChunkedArray<StringType>
pub fn apply_mut<'a, F>(&'a self, f: F) -> Self
sourcepub fn apply_to_buffer<'a, F>(&'a self, f: F) -> Self
pub fn apply_to_buffer<'a, F>(&'a self, f: F) -> Self
Utility that reuses an string buffer to amortize allocations.
Prefer this over an apply
that returns an owned String
.
source§impl ChunkedArray<Float32Type>
impl ChunkedArray<Float32Type>
Used to save compilation paths. Use carefully. Although this is safe, if misused it can lead to incorrect results.
source§impl<T: PolarsDataType> ChunkedArray<T>
impl<T: PolarsDataType> ChunkedArray<T>
sourcepub fn null_count(&self) -> usize
pub fn null_count(&self) -> usize
Return the number of null values in the ChunkedArray.
sourcepub unsafe fn set_null_count(&mut self, null_count: IdxSize)
pub unsafe fn set_null_count(&mut self, null_count: IdxSize)
Set the null count directly.
This can be useful after mutably adjusting the validity of the underlying arrays.
§Safety
The new null count must match the total null count of the underlying arrays.
pub fn rechunk(&self) -> Self
sourcepub fn slice(&self, offset: i64, length: usize) -> Self
pub fn slice(&self, offset: i64, length: usize) -> Self
Slice the array. The chunks are reallocated the underlying data slices are zero copy.
When offset is negative it will be counted from the end of the array. This method will never error, and will slice the best match when offset, or length is out of bounds
sourcepub fn limit(&self, num_elements: usize) -> Selfwhere
Self: Sized,
pub fn limit(&self, num_elements: usize) -> Selfwhere
Self: Sized,
Take a view of top n elements
sourcepub fn head(&self, length: Option<usize>) -> Selfwhere
Self: Sized,
pub fn head(&self, length: Option<usize>) -> Selfwhere
Self: Sized,
Get the head of the ChunkedArray
sourcepub fn tail(&self, length: Option<usize>) -> Selfwhere
Self: Sized,
pub fn tail(&self, length: Option<usize>) -> Selfwhere
Self: Sized,
Get the tail of the ChunkedArray
sourcepub fn prune_empty_chunks(&mut self)
pub fn prune_empty_chunks(&mut self)
Remove empty chunks.
source§impl ChunkedArray<StringType>
impl ChunkedArray<StringType>
sourcepub fn to_decimal(&self, infer_length: usize) -> PolarsResult<Series>
Available on crate feature dtype-decimal
only.
pub fn to_decimal(&self, infer_length: usize) -> PolarsResult<Series>
dtype-decimal
only.Convert an StringChunked
to a Series
of DataType::Decimal
.
Scale needed for the decimal type are inferred. Parsing is not strict.
Scale inference assumes that all tested strings are well-formed numbers,
and may produce unexpected results for scale if this is not the case.
If the decimal precision
and scale
are already known, consider
using the cast
method.
source§impl<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
extend
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
.
source§impl<T> ChunkedArray<T>where
T: PolarsDataType,
impl<T> ChunkedArray<T>where
T: PolarsDataType,
source§impl ChunkedArray<ListType>
impl ChunkedArray<ListType>
pub fn full_null_with_dtype( name: &str, length: usize, inner_dtype: &DataType ) -> ListChunked
source§impl ChunkedArray<UInt32Type>
impl ChunkedArray<UInt32Type>
pub fn with_nullable_idx<T, F: FnOnce(&IdxCa) -> T>( idx: &[NullableIdxSize], f: F ) -> T
source§impl<T: PolarsDataType> ChunkedArray<T>
impl<T: PolarsDataType> ChunkedArray<T>
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.
source§impl<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_map_float<F>(
&self,
window_size: usize,
f: F
) -> PolarsResult<Self>
Available on crate feature rolling_window
only.
pub fn rolling_map_float<F>( &self, window_size: usize, f: F ) -> PolarsResult<Self>
rolling_window
only.Apply a rolling custom function. This is pretty slow because of dynamic dispatch.
source§impl ChunkedArray<BinaryType>
impl ChunkedArray<BinaryType>
sourcepub unsafe fn to_string_unchecked(&self) -> StringChunked
pub unsafe fn to_string_unchecked(&self) -> StringChunked
§Safety
String is not validated
source§impl ChunkedArray<StringType>
impl ChunkedArray<StringType>
pub fn as_binary(&self) -> BinaryChunked
source§impl ChunkedArray<BooleanType>
impl ChunkedArray<BooleanType>
sourcepub fn any(&self) -> bool
pub fn any(&self) -> bool
Returns whether any of the values in the column are true
.
Null values are ignored.
sourcepub fn all(&self) -> bool
pub fn all(&self) -> bool
Returns whether all values in the array are true
.
Null values are ignored.
sourcepub fn any_kleene(&self) -> Option<bool>
pub fn any_kleene(&self) -> Option<bool>
Returns whether any of the values in the column are true
.
The output is unknown (None
) if the array contains any null values and
no true
values.
sourcepub fn all_kleene(&self) -> Option<bool>
pub fn all_kleene(&self) -> Option<bool>
Returns whether all values in the column are true
.
The output is unknown (None
) if the array contains any null values and
no false
values.
source§impl<T> ChunkedArray<T>
impl<T> ChunkedArray<T>
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.
source§impl<T> ChunkedArray<T>
impl<T> ChunkedArray<T>
pub fn to_canonical(&self) -> Self
source§impl ChunkedArray<ListType>
impl ChunkedArray<ListType>
source§impl<T> ChunkedArray<T>where
T: PolarsDataType,
impl<T> ChunkedArray<T>where
T: PolarsDataType,
pub fn iter(&self) -> impl PolarsIterator<Item = Option<T::Physical<'_>>>
source§impl<T> ChunkedArray<T>where
T: PolarsNumericType,
impl<T> ChunkedArray<T>where
T: PolarsNumericType,
sourcepub fn to_ndarray(&self) -> PolarsResult<ArrayView1<'_, T::Native>>
Available on crate feature ndarray
only.
pub fn to_ndarray(&self) -> PolarsResult<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
source§impl ChunkedArray<ListType>
impl ChunkedArray<ListType>
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<T> ChunkedArray<T>
impl<T> ChunkedArray<T>
source§impl<T> ChunkedArray<T>where
T: PolarsDataType,
impl<T> ChunkedArray<T>where
T: PolarsDataType,
pub fn with_chunk<A>(name: &str, arr: A) -> Selfwhere
A: Array,
T: PolarsDataType<Array = A>,
pub fn with_chunk_like<A>(ca: &Self, arr: A) -> Selfwhere
A: Array,
T: PolarsDataType<Array = A>,
pub fn from_chunk_iter<I>(name: &str, iter: I) -> Selfwhere
I: IntoIterator,
T: PolarsDataType<Array = <I as IntoIterator>::Item>,
<I as IntoIterator>::Item: Array,
pub fn from_chunk_iter_like<I>(ca: &Self, iter: I) -> Selfwhere
I: IntoIterator,
T: PolarsDataType<Array = <I as IntoIterator>::Item>,
<I as IntoIterator>::Item: Array,
pub fn try_from_chunk_iter<I, A, E>(name: &str, iter: I) -> Result<Self, E>
sourcepub unsafe fn from_chunks(name: &str, chunks: Vec<ArrayRef>) -> Self
pub unsafe fn from_chunks(name: &str, chunks: Vec<ArrayRef>) -> Self
Create a new ChunkedArray
from existing chunks.
§Safety
The Arrow datatype of all chunks must match the PolarsDataType
T
.
sourcepub unsafe fn with_chunks(&self, chunks: Vec<ArrayRef>) -> Self
pub unsafe fn with_chunks(&self, chunks: Vec<ArrayRef>) -> Self
§Safety
The Arrow datatype of all chunks must match the PolarsDataType
T
.
sourcepub unsafe fn from_chunks_and_dtype(
name: &str,
chunks: Vec<ArrayRef>,
dtype: DataType
) -> Self
pub unsafe fn from_chunks_and_dtype( name: &str, chunks: Vec<ArrayRef>, dtype: DataType ) -> Self
Create a new ChunkedArray
from existing chunks.
§Safety
The Arrow datatype of all chunks must match the PolarsDataType
T
.
pub fn full_null_like(ca: &Self, length: usize) -> Self
source§impl<T> ChunkedArray<T>where
T: PolarsNumericType,
impl<T> ChunkedArray<T>where
T: PolarsNumericType,
sourcepub fn from_vec(name: &str, v: Vec<T::Native>) -> Self
pub fn from_vec(name: &str, v: Vec<T::Native>) -> Self
Create a new ChunkedArray by taking ownership of the Vec. This operation is zero copy.
sourcepub fn from_vec_validity(
name: &str,
values: Vec<T::Native>,
buffer: Option<Bitmap>
) -> Self
pub fn from_vec_validity( name: &str, values: Vec<T::Native>, buffer: Option<Bitmap> ) -> Self
Create a new ChunkedArray from a Vec and a validity mask.
sourcepub unsafe fn mmap_slice(name: &str, values: &[T::Native]) -> Self
pub unsafe fn mmap_slice(name: &str, values: &[T::Native]) -> Self
Create a temporary ChunkedArray
from a slice.
§Safety
The lifetime will be bound to the lifetime of the slice. This will not be checked by the borrowchecker.
source§impl ChunkedArray<BooleanType>
impl ChunkedArray<BooleanType>
sourcepub unsafe fn mmap_slice(
name: &str,
values: &[u8],
offset: usize,
len: usize
) -> Self
pub unsafe fn mmap_slice( name: &str, values: &[u8], offset: usize, len: usize ) -> Self
Create a temporary ChunkedArray
from a slice.
§Safety
The lifetime will be bound to the lifetime of the slice. This will not be checked by the borrowchecker.
source§impl 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 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 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.
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 ChunkedArray<Int128Type>
impl ChunkedArray<Int128Type>
pub fn into_decimal_unchecked( self, precision: Option<usize>, scale: usize ) -> DecimalChunked
dtype-decimal
only.pub fn into_decimal( self, precision: Option<usize>, scale: usize ) -> PolarsResult<DecimalChunked>
dtype-decimal
only.source§impl<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.pub fn new_from_vec_and_validity( name: &str, v: Vec<T>, validity: Bitmap ) -> Self
object
only.pub fn new_empty(name: &str) -> Self
object
only.source§impl<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.
source§impl<T> ChunkedArray<T>
impl<T> ChunkedArray<T>
source§impl<T> ChunkedArray<T>
impl<T> ChunkedArray<T>
sourcepub fn sample_n(
&self,
n: usize,
with_replacement: bool,
shuffle: bool,
seed: Option<u64>
) -> PolarsResult<Self>
Available on crate feature random
only.
pub fn sample_n( &self, n: usize, with_replacement: bool, shuffle: bool, seed: Option<u64> ) -> PolarsResult<Self>
random
only.Sample n datapoints from this ChunkedArray
.
sourcepub fn sample_frac(
&self,
frac: f64,
with_replacement: bool,
shuffle: bool,
seed: Option<u64>
) -> PolarsResult<Self>
Available on crate feature random
only.
pub fn sample_frac( &self, frac: f64, with_replacement: bool, shuffle: bool, seed: Option<u64> ) -> PolarsResult<Self>
random
only.Sample a fraction between 0.0-1.0 of this ChunkedArray
.
source§impl<T> ChunkedArray<T>
impl<T> ChunkedArray<T>
sourcepub fn rand_normal(
name: &str,
length: usize,
mean: f64,
std_dev: f64
) -> PolarsResult<Self>
Available on crate feature random
only.
pub fn rand_normal( name: &str, length: usize, mean: f64, std_dev: f64 ) -> PolarsResult<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.
sourcepub fn rand_uniform(name: &str, length: usize, low: f64, high: f64) -> Self
Available on crate feature random
only.
pub fn rand_uniform(name: &str, length: usize, low: f64, high: f64) -> Self
random
only.Create ChunkedArray
with samples from a Uniform distribution.
source§impl ChunkedArray<BooleanType>
impl ChunkedArray<BooleanType>
sourcepub fn rand_bernoulli(name: &str, length: usize, p: f64) -> PolarsResult<Self>
Available on crate feature random
only.
pub fn rand_bernoulli(name: &str, length: usize, p: f64) -> PolarsResult<Self>
random
only.Create ChunkedArray
with samples from a Bernoulli distribution.
source§impl<T: PolarsNumericType> ChunkedArray<T>
impl<T: PolarsNumericType> ChunkedArray<T>
source§impl<T: PolarsDataType> ChunkedArray<T>
impl<T: PolarsDataType> ChunkedArray<T>
sourcepub fn new_with_compute_len(field: Arc<Field>, chunks: Vec<ArrayRef>) -> Self
pub fn new_with_compute_len(field: Arc<Field>, chunks: Vec<ArrayRef>) -> Self
Create a new ChunkedArray
and compute its length
and null_count
.
If you want to explicitly the length
and null_count
, look at
ChunkedArray::new_with_dims
sourcepub unsafe fn new_with_dims(
field: Arc<Field>,
chunks: Vec<ArrayRef>,
length: IdxSize,
null_count: IdxSize
) -> Self
pub unsafe fn new_with_dims( field: Arc<Field>, chunks: Vec<ArrayRef>, length: IdxSize, null_count: IdxSize ) -> Self
Create a new ChunkedArray
and explicitly set its length
and null_count
.
If you want to compute the length
and null_count
, look at
ChunkedArray::new_with_compute_len
§Safety
The length and null_count must be correct.
sourcepub fn effective_metadata(&self) -> &Metadata<T>
pub fn effective_metadata(&self) -> &Metadata<T>
Get a reference to the used Metadata
This results a reference to an empty Metadata
if its unset for this ChunkedArray
.
sourcepub fn metadata_arc(&self) -> Option<&Arc<Metadata<T>>>
pub fn metadata_arc(&self) -> Option<&Arc<Metadata<T>>>
Get a reference to Arc
that contains the ChunkedArray
’s Metadata
sourcepub fn metadata_owned_arc(&self) -> Arc<Metadata<T>>
pub fn metadata_owned_arc(&self) -> Arc<Metadata<T>>
Get a Arc
that contains the ChunkedArray
’s Metadata
sourcepub fn metadata_mut(&mut self) -> &mut Arc<Metadata<T>>
pub fn metadata_mut(&mut self) -> &mut Arc<Metadata<T>>
Get a mutable reference to the Arc
that contains the ChunkedArray
’s Metadata
pub fn unset_fast_explode_list(&mut self)
pub fn set_fast_explode_list(&mut self, value: bool)
pub fn get_fast_explode_list(&self) -> bool
pub fn get_flags(&self) -> MetadataFlags
pub fn is_sorted_flag(&self) -> IsSorted
sourcepub fn set_sorted_flag(&mut self, sorted: IsSorted)
pub fn set_sorted_flag(&mut self, sorted: IsSorted)
Set the ‘sorted’ bit meta info.
sourcepub fn with_sorted_flag(&self, sorted: IsSorted) -> Self
pub fn with_sorted_flag(&self, sorted: IsSorted) -> Self
Set the ‘sorted’ bit meta info.
pub fn get_min_value(&self) -> Option<&T::OwnedPhysical>
pub fn get_max_value(&self) -> Option<&T::OwnedPhysical>
pub fn get_distinct_count(&self) -> Option<IdxSize>
pub fn merge_metadata(&mut self, md: Metadata<T>)
sourcepub fn copy_metadata_cast<O: PolarsDataType>(
&mut self,
other: &ChunkedArray<O>,
props: MetadataProperties
)
pub fn copy_metadata_cast<O: PolarsDataType>( &mut self, other: &ChunkedArray<O>, props: MetadataProperties )
Copies Metadata
properties specified by props
from other
with different underlying PolarsDataType
into
self
.
This does not copy the properties with a different type between the Metadata
s (e.g.
min_value
and max_value
) and will panic on debug builds if that is attempted.
sourcepub fn copy_metadata(&mut self, other: &Self, props: MetadataProperties)
pub fn copy_metadata(&mut self, other: &Self, props: MetadataProperties)
Copies Metadata
properties specified by props
from other
into self
.
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 last_non_null(&self) -> Option<usize>
pub fn last_non_null(&self) -> Option<usize>
Get the index of the last non null value in this ChunkedArray
.
pub fn drop_nulls(&self) -> Self
sourcepub fn iter_validities(
&self
) -> Map<Iter<'_, ArrayRef>, fn(_: &ArrayRef) -> Option<&Bitmap>> ⓘ
pub fn iter_validities( &self ) -> Map<Iter<'_, ArrayRef>, fn(_: &ArrayRef) -> 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 its length.
pub fn clear(&self) -> Self
sourcepub fn unpack_series_matching_type(
&self,
series: &Series
) -> PolarsResult<&ChunkedArray<T>>
pub fn unpack_series_matching_type( &self, series: &Series ) -> PolarsResult<&ChunkedArray<T>>
Series to ChunkedArray<T>
sourcepub fn chunk_lengths(&self) -> ChunkLenIter<'_>
pub fn chunk_lengths(&self) -> ChunkLenIter<'_>
Returns an iterator over the lengths of the chunks of the array.
sourcepub unsafe fn chunks_mut(&mut self) -> &mut Vec<ArrayRef>
pub unsafe fn chunks_mut(&mut self) -> &mut Vec<ArrayRef>
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 dtype(&self) -> &DataType
pub fn dtype(&self) -> &DataType
Get data type of ChunkedArray
.
sourcepub fn name(&self) -> &str
pub fn name(&self) -> &str
Name of the ChunkedArray
.
sourcepub fn rename(&mut self, name: &str)
pub fn rename(&mut self, name: &str)
Rename this ChunkedArray
.
sourcepub fn with_name(self, name: &str) -> Self
pub fn with_name(self, name: &str) -> Self
Return this ChunkedArray
with a new name.
source§impl<T> ChunkedArray<T>where
T: PolarsDataType,
impl<T> ChunkedArray<T>where
T: PolarsDataType,
sourcepub fn get(&self, idx: usize) -> Option<T::Physical<'_>>
pub fn get(&self, idx: usize) -> Option<T::Physical<'_>>
Get a single value from this ChunkedArray
. If the return values is None
this
indicates a NULL value.
§Panics
This function will panic if idx
is out of bounds.
sourcepub unsafe fn get_unchecked(&self, idx: usize) -> Option<T::Physical<'_>>
pub unsafe fn get_unchecked(&self, idx: usize) -> Option<T::Physical<'_>>
Get a single value from this ChunkedArray
. If the return values is None
this
indicates a NULL value.
§Safety
It is the callers responsibility that the idx < self.len()
.
sourcepub unsafe fn value_unchecked(&self, idx: usize) -> T::Physical<'_>
pub unsafe fn value_unchecked(&self, idx: usize) -> T::Physical<'_>
Get a single value from this ChunkedArray
. Null values are ignored and the returned
value could be garbage if it was masked out by NULL. Note that the value always is initialized.
§Safety
It is the callers responsibility that the idx < self.len()
.
pub fn last(&self) -> Option<T::Physical<'_>>
source§impl ChunkedArray<ListType>
impl ChunkedArray<ListType>
pub fn get_as_series(&self, idx: usize) -> Option<Series>
source§impl<T> ChunkedArray<T>where
T: PolarsDataType,
impl<T> ChunkedArray<T>where
T: PolarsDataType,
pub fn layout(&self) -> ChunkedArrayLayout<'_, T>
source§impl<T> ChunkedArray<T>where
T: PolarsNumericType,
impl<T> ChunkedArray<T>where
T: PolarsNumericType,
sourcepub fn cont_slice(&self) -> PolarsResult<&[T::Native]>
pub fn cont_slice(&self) -> PolarsResult<&[T::Native]>
Returns the values of the array as a contiguous slice.
sourcepub fn data_views(&self) -> impl DoubleEndedIterator<Item = &[T::Native]>
pub fn data_views(&self) -> impl DoubleEndedIterator<Item = &[T::Native]>
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 '_ + Send + Sync + ExactSizeIterator<Item = T::Native> + DoubleEndedIterator + TrustedLen
source§impl<T> ChunkedArray<T>
impl<T> ChunkedArray<T>
pub fn group_tuples_perfect( &self, max: usize, multithreaded: bool, group_capacity: usize ) -> GroupsProxy
algorithm_group_by
only.source§impl<T: PolarsNumericType> ChunkedArray<T>
impl<T: PolarsNumericType> ChunkedArray<T>
source§impl<T> ChunkedArray<T>
impl<T> ChunkedArray<T>
We cannot override the left hand side behaviour. So we create a trait LhsNumOps. This allows for 1.add(&Series)
Trait Implementations§
source§impl<T: PolarsNumericType, N: Num + ToPrimitive> Add<N> for &ChunkedArray<T>
impl<T: PolarsNumericType, N: Num + ToPrimitive> Add<N> for &ChunkedArray<T>
source§impl<T: PolarsNumericType, N: Num + ToPrimitive> Add<N> for ChunkedArray<T>
impl<T: PolarsNumericType, N: Num + ToPrimitive> Add<N> for ChunkedArray<T>
source§impl<T: PolarsNumericType> Add for &ChunkedArray<T>
impl<T: PolarsNumericType> Add for &ChunkedArray<T>
source§impl<T: PolarsNumericType> Add for ChunkedArray<T>
impl<T: PolarsNumericType> Add for ChunkedArray<T>
source§impl<T> AggList for ChunkedArray<T>
Available on crate feature algorithm_group_by
only.
impl<T> AggList for ChunkedArray<T>
algorithm_group_by
only.source§impl<T: PolarsNumericType> ArithmeticChunked for &ChunkedArray<T>
impl<T: PolarsNumericType> ArithmeticChunked for &ChunkedArray<T>
type Scalar = <T as PolarsNumericType>::Native
type Out = ChunkedArray<T>
type TrueDivOut = ChunkedArray<<<T as PolarsNumericType>::Native as NumericNative>::TrueDivPolarsType>
fn wrapping_abs(self) -> Self::Out
fn wrapping_neg(self) -> Self::Out
fn wrapping_add(self, rhs: Self) -> Self::Out
fn wrapping_sub(self, rhs: Self) -> Self::Out
fn wrapping_mul(self, rhs: Self) -> Self::Out
fn wrapping_floor_div(self, rhs: Self) -> Self::Out
fn wrapping_trunc_div(self, rhs: Self) -> Self::Out
fn wrapping_mod(self, rhs: Self) -> Self::Out
fn wrapping_add_scalar(self, rhs: Self::Scalar) -> Self::Out
fn wrapping_sub_scalar(self, rhs: Self::Scalar) -> Self::Out
fn wrapping_sub_scalar_lhs(lhs: Self::Scalar, rhs: Self) -> Self::Out
fn wrapping_mul_scalar(self, rhs: Self::Scalar) -> Self::Out
fn wrapping_floor_div_scalar(self, rhs: Self::Scalar) -> Self::Out
fn wrapping_floor_div_scalar_lhs(lhs: Self::Scalar, rhs: Self) -> Self::Out
fn wrapping_trunc_div_scalar(self, rhs: Self::Scalar) -> Self::Out
fn wrapping_trunc_div_scalar_lhs(lhs: Self::Scalar, rhs: Self) -> Self::Out
fn wrapping_mod_scalar(self, rhs: Self::Scalar) -> Self::Out
fn wrapping_mod_scalar_lhs(lhs: Self::Scalar, rhs: Self) -> Self::Out
fn true_div(self, rhs: Self) -> Self::TrueDivOut
fn true_div_scalar(self, rhs: Self::Scalar) -> Self::TrueDivOut
fn true_div_scalar_lhs(lhs: Self::Scalar, rhs: Self) -> Self::TrueDivOut
fn legacy_div(self, rhs: Self) -> Self::Out
fn legacy_div_scalar(self, rhs: Self::Scalar) -> Self::Out
fn legacy_div_scalar_lhs(lhs: Self::Scalar, rhs: Self) -> Self::Out
source§impl<T: PolarsNumericType> ArithmeticChunked for ChunkedArray<T>
impl<T: PolarsNumericType> ArithmeticChunked for ChunkedArray<T>
type Scalar = <T as PolarsNumericType>::Native
type Out = ChunkedArray<T>
type TrueDivOut = ChunkedArray<<<T as PolarsNumericType>::Native as NumericNative>::TrueDivPolarsType>
fn wrapping_abs(self) -> Self::Out
fn wrapping_neg(self) -> Self::Out
fn wrapping_add(self, rhs: Self) -> Self::Out
fn wrapping_sub(self, rhs: Self) -> Self::Out
fn wrapping_mul(self, rhs: Self) -> Self::Out
fn wrapping_floor_div(self, rhs: Self) -> Self::Out
fn wrapping_trunc_div(self, rhs: Self) -> Self::Out
fn wrapping_mod(self, rhs: Self) -> Self::Out
fn wrapping_add_scalar(self, rhs: Self::Scalar) -> Self::Out
fn wrapping_sub_scalar(self, rhs: Self::Scalar) -> Self::Out
fn wrapping_sub_scalar_lhs(lhs: Self::Scalar, rhs: Self) -> Self::Out
fn wrapping_mul_scalar(self, rhs: Self::Scalar) -> Self::Out
fn wrapping_floor_div_scalar(self, rhs: Self::Scalar) -> Self::Out
fn wrapping_floor_div_scalar_lhs(lhs: Self::Scalar, rhs: Self) -> Self::Out
fn wrapping_trunc_div_scalar(self, rhs: Self::Scalar) -> Self::Out
fn wrapping_trunc_div_scalar_lhs(lhs: Self::Scalar, rhs: Self) -> Self::Out
fn wrapping_mod_scalar(self, rhs: Self::Scalar) -> Self::Out
fn wrapping_mod_scalar_lhs(lhs: Self::Scalar, rhs: Self) -> Self::Out
fn true_div(self, rhs: Self) -> Self::TrueDivOut
fn true_div_scalar(self, rhs: Self::Scalar) -> Self::TrueDivOut
fn true_div_scalar_lhs(lhs: Self::Scalar, rhs: Self) -> Self::TrueDivOut
fn legacy_div(self, rhs: Self) -> Self::Out
fn legacy_div_scalar(self, rhs: Self::Scalar) -> Self::Out
fn legacy_div_scalar_lhs(lhs: Self::Scalar, rhs: Self) -> Self::Out
source§impl<'a, T> AsMut<ChunkedArray<T>> for dyn SeriesTrait + 'awhere
T: 'static + PolarsDataType,
impl<'a, T> AsMut<ChunkedArray<T>> for dyn SeriesTrait + 'awhere
T: 'static + PolarsDataType,
source§fn as_mut(&mut self) -> &mut ChunkedArray<T>
fn as_mut(&mut self) -> &mut ChunkedArray<T>
source§impl<T: PolarsDataType> AsRef<ChunkedArray<T>> for ChunkedArray<T>
impl<T: PolarsDataType> AsRef<ChunkedArray<T>> for ChunkedArray<T>
source§fn as_ref(&self) -> &ChunkedArray<T>
fn as_ref(&self) -> &ChunkedArray<T>
source§impl<'a, T> AsRef<ChunkedArray<T>> for dyn SeriesTrait + 'awhere
T: 'static + PolarsDataType,
impl<'a, T> AsRef<ChunkedArray<T>> for dyn SeriesTrait + 'awhere
T: 'static + PolarsDataType,
source§fn as_ref(&self) -> &ChunkedArray<T>
fn as_ref(&self) -> &ChunkedArray<T>
source§impl<T: PolarsDataType> AsRefDataType for ChunkedArray<T>
impl<T: PolarsDataType> AsRefDataType for ChunkedArray<T>
fn as_ref_dtype(&self) -> &DataType
source§impl<T> BitAnd for &ChunkedArray<T>
impl<T> BitAnd for &ChunkedArray<T>
source§impl<T> BitOr for &ChunkedArray<T>
impl<T> BitOr for &ChunkedArray<T>
source§impl<T> BitXor for &ChunkedArray<T>
impl<T> BitXor for &ChunkedArray<T>
source§impl<T> ChunkAgg<<T as PolarsNumericType>::Native> for ChunkedArray<T>
impl<T> ChunkAgg<<T as PolarsNumericType>::Native> for ChunkedArray<T>
source§fn sum(&self) -> Option<T::Native>
fn sum(&self) -> Option<T::Native>
None
if not implemented for T
.
If the array is empty, 0
is returnedfn min(&self) -> Option<T::Native>
source§fn max(&self) -> Option<T::Native>
fn max(&self) -> Option<T::Native>
None
if the array is empty or only contains null values.fn min_max(&self) -> Option<(T::Native, T::Native)>
source§impl<T> ChunkAggSeries for ChunkedArray<T>where
T: PolarsNumericType,
PrimitiveArray<T::Native>: for<'a> MinMaxKernel<Scalar<'a> = T::Native>,
<T::Native as Simd>::Simd: Add<Output = <T::Native as Simd>::Simd> + Sum<T::Native>,
ChunkedArray<T>: IntoSeries,
impl<T> ChunkAggSeries for ChunkedArray<T>where
T: PolarsNumericType,
PrimitiveArray<T::Native>: for<'a> MinMaxKernel<Scalar<'a> = T::Native>,
<T::Native as Simd>::Simd: Add<Output = <T::Native as Simd>::Simd> + Sum<T::Native>,
ChunkedArray<T>: IntoSeries,
source§fn sum_reduce(&self) -> Scalar
fn sum_reduce(&self) -> Scalar
ChunkedArray
as a new Series
of length 1.source§fn max_reduce(&self) -> Scalar
fn max_reduce(&self) -> Scalar
ChunkedArray
as a new Series
of length 1.source§fn min_reduce(&self) -> Scalar
fn min_reduce(&self) -> Scalar
ChunkedArray
as a new Series
of length 1.source§fn prod_reduce(&self) -> Scalar
fn prod_reduce(&self) -> Scalar
ChunkedArray
as a new Series
of length 1.source§impl<T> ChunkAnyValue for ChunkedArray<T>where
T: PolarsNumericType,
impl<T> ChunkAnyValue for ChunkedArray<T>where
T: PolarsNumericType,
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, T> ChunkApply<'a, <T as PolarsNumericType>::Native> for ChunkedArray<T>where
T: PolarsNumericType,
impl<'a, T> ChunkApply<'a, <T as PolarsNumericType>::Native> for ChunkedArray<T>where
T: PolarsNumericType,
type FuncRet = <T as PolarsNumericType>::Native
source§fn apply_values<F>(&'a self, f: F) -> Self
fn apply_values<F>(&'a self, f: F) -> Self
source§impl<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,
source§fn apply_kernel(
&self,
f: &dyn Fn(&PrimitiveArray<T::Native>) -> ArrayRef
) -> Self
fn apply_kernel( &self, f: &dyn Fn(&PrimitiveArray<T::Native>) -> ArrayRef ) -> Self
source§fn 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,
source§impl<T> ChunkCast for ChunkedArray<T>where
T: PolarsNumericType,
impl<T> ChunkCast for ChunkedArray<T>where
T: PolarsNumericType,
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<BinaryType>> for BinaryChunked
impl ChunkCompare<&ChunkedArray<BinaryType>> for BinaryChunked
type Item = ChunkedArray<BooleanType>
source§fn equal(&self, rhs: &BinaryChunked) -> BooleanChunked
fn equal(&self, rhs: &BinaryChunked) -> BooleanChunked
source§fn equal_missing(&self, rhs: &BinaryChunked) -> BooleanChunked
fn equal_missing(&self, rhs: &BinaryChunked) -> BooleanChunked
None == None
.source§fn not_equal(&self, rhs: &BinaryChunked) -> BooleanChunked
fn not_equal(&self, rhs: &BinaryChunked) -> BooleanChunked
source§fn not_equal_missing(&self, rhs: &BinaryChunked) -> BooleanChunked
fn not_equal_missing(&self, rhs: &BinaryChunked) -> BooleanChunked
None == None
.source§fn lt(&self, rhs: &BinaryChunked) -> BooleanChunked
fn lt(&self, rhs: &BinaryChunked) -> BooleanChunked
source§fn lt_eq(&self, rhs: &BinaryChunked) -> BooleanChunked
fn lt_eq(&self, rhs: &BinaryChunked) -> BooleanChunked
source§fn gt(&self, rhs: &Self) -> BooleanChunked
fn gt(&self, rhs: &Self) -> BooleanChunked
source§fn gt_eq(&self, rhs: &Self) -> BooleanChunked
fn gt_eq(&self, rhs: &Self) -> BooleanChunked
source§impl ChunkCompare<&ChunkedArray<BooleanType>> for BooleanChunked
impl ChunkCompare<&ChunkedArray<BooleanType>> for BooleanChunked
type Item = ChunkedArray<BooleanType>
source§fn equal(&self, rhs: &BooleanChunked) -> BooleanChunked
fn equal(&self, rhs: &BooleanChunked) -> BooleanChunked
source§fn equal_missing(&self, rhs: &BooleanChunked) -> BooleanChunked
fn equal_missing(&self, rhs: &BooleanChunked) -> BooleanChunked
None == None
.source§fn not_equal(&self, rhs: &BooleanChunked) -> BooleanChunked
fn not_equal(&self, rhs: &BooleanChunked) -> BooleanChunked
source§fn not_equal_missing(&self, rhs: &BooleanChunked) -> BooleanChunked
fn not_equal_missing(&self, rhs: &BooleanChunked) -> BooleanChunked
None == None
.source§fn lt(&self, rhs: &BooleanChunked) -> BooleanChunked
fn lt(&self, rhs: &BooleanChunked) -> BooleanChunked
source§fn lt_eq(&self, rhs: &BooleanChunked) -> BooleanChunked
fn lt_eq(&self, rhs: &BooleanChunked) -> BooleanChunked
source§fn gt(&self, rhs: &Self) -> BooleanChunked
fn gt(&self, rhs: &Self) -> BooleanChunked
source§fn gt_eq(&self, rhs: &Self) -> BooleanChunked
fn gt_eq(&self, rhs: &Self) -> BooleanChunked
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 ChunkCompare<&ChunkedArray<StringType>> for CategoricalChunked
Available on crate feature dtype-categorical
only.
impl ChunkCompare<&ChunkedArray<StringType>> for CategoricalChunked
dtype-categorical
only.type Item = Result<ChunkedArray<BooleanType>, PolarsError>
source§fn equal(&self, rhs: &StringChunked) -> Self::Item
fn equal(&self, rhs: &StringChunked) -> Self::Item
source§fn equal_missing(&self, rhs: &StringChunked) -> Self::Item
fn equal_missing(&self, rhs: &StringChunked) -> Self::Item
None == None
.source§fn not_equal(&self, rhs: &StringChunked) -> Self::Item
fn not_equal(&self, rhs: &StringChunked) -> Self::Item
source§fn not_equal_missing(&self, rhs: &StringChunked) -> Self::Item
fn not_equal_missing(&self, rhs: &StringChunked) -> Self::Item
None == None
.source§fn gt(&self, rhs: &StringChunked) -> Self::Item
fn gt(&self, rhs: &StringChunked) -> Self::Item
source§fn gt_eq(&self, rhs: &StringChunked) -> Self::Item
fn gt_eq(&self, rhs: &StringChunked) -> Self::Item
source§fn lt(&self, rhs: &StringChunked) -> Self::Item
fn lt(&self, rhs: &StringChunked) -> Self::Item
source§fn lt_eq(&self, rhs: &StringChunked) -> Self::Item
fn lt_eq(&self, rhs: &StringChunked) -> Self::Item
source§impl ChunkCompare<&ChunkedArray<StringType>> for StringChunked
impl ChunkCompare<&ChunkedArray<StringType>> for StringChunked
type Item = ChunkedArray<BooleanType>
source§fn equal(&self, rhs: &StringChunked) -> BooleanChunked
fn equal(&self, rhs: &StringChunked) -> BooleanChunked
source§fn equal_missing(&self, rhs: &StringChunked) -> BooleanChunked
fn equal_missing(&self, rhs: &StringChunked) -> BooleanChunked
None == None
.source§fn not_equal(&self, rhs: &StringChunked) -> BooleanChunked
fn not_equal(&self, rhs: &StringChunked) -> BooleanChunked
source§fn not_equal_missing(&self, rhs: &StringChunked) -> BooleanChunked
fn not_equal_missing(&self, rhs: &StringChunked) -> BooleanChunked
None == None
.source§fn gt(&self, rhs: &StringChunked) -> BooleanChunked
fn gt(&self, rhs: &StringChunked) -> BooleanChunked
source§fn gt_eq(&self, rhs: &StringChunked) -> BooleanChunked
fn gt_eq(&self, rhs: &StringChunked) -> BooleanChunked
source§fn lt(&self, rhs: &StringChunked) -> BooleanChunked
fn lt(&self, rhs: &StringChunked) -> BooleanChunked
source§fn lt_eq(&self, rhs: &StringChunked) -> BooleanChunked
fn lt_eq(&self, rhs: &StringChunked) -> BooleanChunked
source§impl<T> ChunkCompare<&ChunkedArray<T>> for ChunkedArray<T>
impl<T> ChunkCompare<&ChunkedArray<T>> for ChunkedArray<T>
type Item = ChunkedArray<BooleanType>
source§fn equal(&self, rhs: &ChunkedArray<T>) -> BooleanChunked
fn equal(&self, rhs: &ChunkedArray<T>) -> BooleanChunked
source§fn equal_missing(&self, rhs: &ChunkedArray<T>) -> BooleanChunked
fn equal_missing(&self, rhs: &ChunkedArray<T>) -> BooleanChunked
None == None
.source§fn not_equal(&self, rhs: &ChunkedArray<T>) -> BooleanChunked
fn not_equal(&self, rhs: &ChunkedArray<T>) -> BooleanChunked
source§fn not_equal_missing(&self, rhs: &ChunkedArray<T>) -> BooleanChunked
fn not_equal_missing(&self, rhs: &ChunkedArray<T>) -> BooleanChunked
None == None
.source§fn lt(&self, rhs: &ChunkedArray<T>) -> BooleanChunked
fn lt(&self, rhs: &ChunkedArray<T>) -> BooleanChunked
source§fn lt_eq(&self, rhs: &ChunkedArray<T>) -> BooleanChunked
fn lt_eq(&self, rhs: &ChunkedArray<T>) -> BooleanChunked
source§fn gt(&self, rhs: &Self) -> BooleanChunked
fn gt(&self, rhs: &Self) -> BooleanChunked
source§fn gt_eq(&self, rhs: &Self) -> BooleanChunked
fn gt_eq(&self, rhs: &Self) -> BooleanChunked
source§impl<T, Rhs> ChunkCompare<Rhs> for ChunkedArray<T>
impl<T, Rhs> ChunkCompare<Rhs> for ChunkedArray<T>
type Item = ChunkedArray<BooleanType>
source§fn equal(&self, rhs: Rhs) -> BooleanChunked
fn equal(&self, rhs: Rhs) -> BooleanChunked
source§fn equal_missing(&self, rhs: Rhs) -> BooleanChunked
fn equal_missing(&self, rhs: Rhs) -> BooleanChunked
None == None
.source§fn not_equal(&self, rhs: Rhs) -> BooleanChunked
fn not_equal(&self, rhs: Rhs) -> BooleanChunked
source§fn not_equal_missing(&self, rhs: Rhs) -> BooleanChunked
fn not_equal_missing(&self, rhs: Rhs) -> BooleanChunked
None == None
.source§fn gt(&self, rhs: Rhs) -> BooleanChunked
fn gt(&self, rhs: Rhs) -> BooleanChunked
source§fn gt_eq(&self, rhs: Rhs) -> BooleanChunked
fn gt_eq(&self, rhs: Rhs) -> BooleanChunked
source§fn lt(&self, rhs: Rhs) -> BooleanChunked
fn lt(&self, rhs: Rhs) -> BooleanChunked
source§fn lt_eq(&self, rhs: Rhs) -> BooleanChunked
fn lt_eq(&self, rhs: Rhs) -> BooleanChunked
source§impl<T: PolarsNumericType> ChunkExpandAtIndex<T> for ChunkedArray<T>
impl<T: PolarsNumericType> ChunkExpandAtIndex<T> for ChunkedArray<T>
source§fn new_from_index(&self, index: usize, length: usize) -> ChunkedArray<T>
fn new_from_index(&self, index: usize, length: usize) -> ChunkedArray<T>
source§impl<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,
source§fn fill_null_with_values(&self, value: T::Native) -> PolarsResult<Self>
fn fill_null_with_values(&self, value: T::Native) -> PolarsResult<Self>
T
.source§impl<T> ChunkFilter<T> for ChunkedArray<T>where
T: PolarsNumericType,
impl<T> ChunkFilter<T> for ChunkedArray<T>where
T: PolarsNumericType,
source§fn filter(&self, filter: &BooleanChunked) -> PolarsResult<ChunkedArray<T>>
fn filter(&self, filter: &BooleanChunked) -> PolarsResult<ChunkedArray<T>>
source§impl<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,
source§impl<T> ChunkFullNull for ChunkedArray<T>where
T: PolarsNumericType,
impl<T> ChunkFullNull for ChunkedArray<T>where
T: PolarsNumericType,
source§impl<T> ChunkQuantile<f64> for ChunkedArray<T>
impl<T> ChunkQuantile<f64> for ChunkedArray<T>
source§fn quantile(
&self,
quantile: f64,
interpol: QuantileInterpolOptions
) -> PolarsResult<Option<f64>>
fn quantile( &self, quantile: f64, interpol: QuantileInterpolOptions ) -> PolarsResult<Option<f64>>
None
if the array is empty or only contains null values.source§impl<T> ChunkReverse for ChunkedArray<T>where
T: PolarsNumericType,
impl<T> ChunkReverse for ChunkedArray<T>where
T: PolarsNumericType,
source§fn reverse(&self) -> ChunkedArray<T>
fn reverse(&self) -> ChunkedArray<T>
source§impl<T> ChunkRollApply for ChunkedArray<T>where
T: PolarsNumericType,
Self: IntoSeries,
Available on crate feature rolling_window
only.
impl<T> ChunkRollApply for ChunkedArray<T>where
T: PolarsNumericType,
Self: IntoSeries,
rolling_window
only.source§fn rolling_map(
&self,
f: &dyn Fn(&Series) -> Series,
options: RollingOptionsFixedWindow
) -> PolarsResult<Series>
fn rolling_map( &self, f: &dyn Fn(&Series) -> Series, options: RollingOptionsFixedWindow ) -> PolarsResult<Series>
Apply a rolling custom function. This is pretty slow because of dynamic dispatch.
source§impl<'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,
source§fn scatter_single<I: IntoIterator<Item = IdxSize>>(
&'a self,
idx: I,
value: Option<T::Native>
) -> PolarsResult<Self>
fn scatter_single<I: IntoIterator<Item = IdxSize>>( &'a self, idx: I, value: Option<T::Native> ) -> PolarsResult<Self>
source§fn scatter_with<I: IntoIterator<Item = IdxSize>, F>(
&'a self,
idx: I,
f: F
) -> PolarsResult<Self>
fn scatter_with<I: IntoIterator<Item = IdxSize>, F>( &'a self, idx: I, f: F ) -> PolarsResult<Self>
idx
by applying a closure to these values. Read moresource§fn set(
&'a self,
mask: &BooleanChunked,
value: Option<T::Native>
) -> PolarsResult<Self>
fn set( &'a self, mask: &BooleanChunked, value: Option<T::Native> ) -> PolarsResult<Self>
source§impl<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>
source§impl<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,
source§fn 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>
fill_value
.source§impl<T> ChunkSort<T> for ChunkedArray<T>where
T: PolarsNumericType,
impl<T> ChunkSort<T> for ChunkedArray<T>where
T: PolarsNumericType,
source§fn arg_sort_multiple(
&self,
by: &[Series],
options: &SortMultipleOptions
) -> PolarsResult<IdxCa>
fn arg_sort_multiple( &self, by: &[Series], options: &SortMultipleOptions ) -> PolarsResult<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>
source§fn sort(&self, descending: bool) -> ChunkedArray<T>
fn sort(&self, descending: bool) -> ChunkedArray<T>
ChunkedArray
.source§fn arg_sort(&self, options: SortOptions) -> IdxCa
fn arg_sort(&self, options: SortOptions) -> IdxCa
source§impl<T: PolarsDataType> ChunkTake<ChunkedArray<UInt32Type>> for ChunkedArray<T>
impl<T: PolarsDataType> ChunkTake<ChunkedArray<UInt32Type>> for ChunkedArray<T>
source§fn take(&self, indices: &IdxCa) -> PolarsResult<Self>
fn take(&self, indices: &IdxCa) -> PolarsResult<Self>
Gather values from ChunkedArray by index.
source§impl<T: PolarsDataType, I: AsRef<[IdxSize]> + ?Sized> ChunkTake<I> for ChunkedArray<T>where
ChunkedArray<T>: ChunkTakeUnchecked<I>,
impl<T: PolarsDataType, I: AsRef<[IdxSize]> + ?Sized> ChunkTake<I> for ChunkedArray<T>where
ChunkedArray<T>: ChunkTakeUnchecked<I>,
source§fn take(&self, indices: &I) -> PolarsResult<Self>
fn take(&self, indices: &I) -> PolarsResult<Self>
Gather values from ChunkedArray by index.
source§impl ChunkTakeUnchecked<ChunkedArray<UInt32Type>> for BinaryChunked
impl ChunkTakeUnchecked<ChunkedArray<UInt32Type>> for BinaryChunked
source§unsafe fn take_unchecked(&self, indices: &IdxCa) -> Self
unsafe fn take_unchecked(&self, indices: &IdxCa) -> Self
Gather values from ChunkedArray by index.
source§impl ChunkTakeUnchecked<ChunkedArray<UInt32Type>> for StringChunked
impl ChunkTakeUnchecked<ChunkedArray<UInt32Type>> for StringChunked
source§unsafe fn take_unchecked(&self, indices: &IdxCa) -> Self
unsafe fn take_unchecked(&self, indices: &IdxCa) -> Self
source§impl<T> ChunkTakeUnchecked<ChunkedArray<UInt32Type>> for ChunkedArray<T>
impl<T> ChunkTakeUnchecked<ChunkedArray<UInt32Type>> for ChunkedArray<T>
source§unsafe fn take_unchecked(&self, indices: &IdxCa) -> Self
unsafe fn take_unchecked(&self, indices: &IdxCa) -> Self
Gather values from ChunkedArray by index.
source§impl<T, I: AsRef<[IdxSize]> + ?Sized> ChunkTakeUnchecked<I> for ChunkedArray<T>
impl<T, I: AsRef<[IdxSize]> + ?Sized> ChunkTakeUnchecked<I> for ChunkedArray<T>
source§unsafe fn take_unchecked(&self, indices: &I) -> Self
unsafe fn take_unchecked(&self, indices: &I) -> Self
Gather values from ChunkedArray by index.
source§impl<T> ChunkUnique for ChunkedArray<T>where
T: PolarsNumericType,
T::Native: TotalHash + TotalEq + ToTotalOrd,
<T::Native as ToTotalOrd>::TotalOrdItem: Hash + Eq + Ord,
ChunkedArray<T>: IntoSeries + for<'a> ChunkCompare<&'a ChunkedArray<T>, Item = BooleanChunked>,
Available on crate feature algorithm_group_by
only.
impl<T> ChunkUnique for ChunkedArray<T>where
T: PolarsNumericType,
T::Native: TotalHash + TotalEq + ToTotalOrd,
<T::Native as ToTotalOrd>::TotalOrdItem: Hash + Eq + Ord,
ChunkedArray<T>: IntoSeries + for<'a> ChunkCompare<&'a ChunkedArray<T>, Item = BooleanChunked>,
algorithm_group_by
only.source§fn unique(&self) -> PolarsResult<Self>
fn unique(&self) -> PolarsResult<Self>
source§fn arg_unique(&self) -> PolarsResult<IdxCa>
fn arg_unique(&self) -> PolarsResult<IdxCa>
ChunkedArray
.
This Vec is sorted.source§fn n_unique(&self) -> PolarsResult<usize>
fn n_unique(&self) -> PolarsResult<usize>
ChunkedArray
source§impl<T> ChunkVar for ChunkedArray<T>
impl<T> ChunkVar for ChunkedArray<T>
source§impl<T> ChunkZip<T> for ChunkedArray<T>where
T: PolarsDataType,
T::Array: for<'a> IfThenElseKernel<Scalar<'a> = T::Physical<'a>>,
ChunkedArray<T>: ChunkExpandAtIndex<T>,
Available on crate feature zip_with
only.
impl<T> ChunkZip<T> for ChunkedArray<T>where
T: PolarsDataType,
T::Array: for<'a> IfThenElseKernel<Scalar<'a> = T::Physical<'a>>,
ChunkedArray<T>: ChunkExpandAtIndex<T>,
zip_with
only.source§fn zip_with(
&self,
mask: &BooleanChunked,
other: &ChunkedArray<T>
) -> PolarsResult<ChunkedArray<T>>
fn zip_with( &self, mask: &BooleanChunked, other: &ChunkedArray<T> ) -> PolarsResult<ChunkedArray<T>>
true
and values
from other
where the mask evaluates false
source§impl<T: PolarsDataType> Clone for ChunkedArray<T>
impl<T: PolarsDataType> Clone for ChunkedArray<T>
source§impl<T: PolarsDataType> Container for ChunkedArray<T>
impl<T: PolarsDataType> Container for ChunkedArray<T>
source§impl Debug for ChunkedArray<BooleanType>
impl Debug for ChunkedArray<BooleanType>
source§impl<T> Debug for ChunkedArray<T>where
T: PolarsNumericType,
impl<T> Debug for ChunkedArray<T>where
T: PolarsNumericType,
source§impl<T: PolarsDataType> Default for ChunkedArray<T>
impl<T: PolarsDataType> Default for ChunkedArray<T>
source§impl<T: PolarsNumericType, N: Num + ToPrimitive> Div<N> for &ChunkedArray<T>
impl<T: PolarsNumericType, N: Num + ToPrimitive> Div<N> for &ChunkedArray<T>
source§impl<T: PolarsNumericType, N: Num + ToPrimitive> Div<N> for ChunkedArray<T>
impl<T: PolarsNumericType, N: Num + ToPrimitive> Div<N> for ChunkedArray<T>
source§impl<T: PolarsNumericType> Div for &ChunkedArray<T>
impl<T: PolarsNumericType> Div for &ChunkedArray<T>
source§impl<T: PolarsNumericType> Div for ChunkedArray<T>
impl<T: PolarsNumericType> Div for ChunkedArray<T>
source§impl<T: PolarsDataType> Drop for ChunkedArray<T>
Available on crate feature object
only.
impl<T: PolarsDataType> Drop for ChunkedArray<T>
object
only.source§impl<'a, T> From<&'a ChunkedArray<T>> for Vec<Option<T::Physical<'a>>>where
T: PolarsDataType,
impl<'a, T> From<&'a ChunkedArray<T>> for Vec<Option<T::Physical<'a>>>where
T: PolarsDataType,
source§fn from(ca: &'a ChunkedArray<T>) -> Self
fn from(ca: &'a ChunkedArray<T>) -> Self
source§impl<T, A> From<A> for ChunkedArray<T>where
T: PolarsDataType<Array = A>,
A: Array,
impl<T, A> From<A> for ChunkedArray<T>where
T: PolarsDataType<Array = A>,
A: Array,
source§impl From<ChunkedArray<BooleanType>> for Vec<Option<bool>>
impl From<ChunkedArray<BooleanType>> for Vec<Option<bool>>
source§fn from(ca: BooleanChunked) -> Self
fn from(ca: BooleanChunked) -> Self
source§impl From<ChunkedArray<StringType>> for Vec<Option<String>>
impl From<ChunkedArray<StringType>> for Vec<Option<String>>
source§fn from(ca: StringChunked) -> Self
fn from(ca: StringChunked) -> Self
source§impl<T> From<ChunkedArray<T>> for Series
impl<T> From<ChunkedArray<T>> for Series
source§fn from(ca: ChunkedArray<T>) -> Self
fn from(ca: ChunkedArray<T>) -> Self
source§impl<T> FromIterator<(Vec<<T as PolarsNumericType>::Native>, Option<Bitmap>)> for ChunkedArray<T>where
T: PolarsNumericType,
impl<T> FromIterator<(Vec<<T as PolarsNumericType>::Native>, Option<Bitmap>)> for ChunkedArray<T>where
T: PolarsNumericType,
source§impl<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
source§impl FromIterator<Option<bool>> for ChunkedArray<BooleanType>
impl FromIterator<Option<bool>> for ChunkedArray<BooleanType>
source§impl<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
source§impl<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,
source§impl<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
) -> Selfwhere
I::IntoIter: TrustedLen,
source§impl 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
) -> Selfwhere
I::IntoIter: TrustedLen,
source§impl<T> IntoGroupsProxy for ChunkedArray<T>
Available on crate feature algorithm_group_by
only.
impl<T> IntoGroupsProxy for ChunkedArray<T>
algorithm_group_by
only.source§fn group_tuples(
&self,
multithreaded: bool,
sorted: bool
) -> PolarsResult<GroupsProxy>
fn group_tuples( &self, multithreaded: bool, sorted: bool ) -> PolarsResult<GroupsProxy>
source§impl<'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>
§type IntoIter = Box<dyn PolarsIterator<Item = <&'a ChunkedArray<T> as IntoIterator>::Item> + 'a>
type IntoIter = Box<dyn PolarsIterator<Item = <&'a ChunkedArray<T> as IntoIterator>::Item> + 'a>
source§impl<T: PolarsDataType + 'static> IntoSeries for ChunkedArray<T>where
SeriesWrap<ChunkedArray<T>>: SeriesTrait,
impl<T: PolarsDataType + 'static> IntoSeries for ChunkedArray<T>where
SeriesWrap<ChunkedArray<T>>: SeriesTrait,
source§impl<T> MetadataCollectable<T> for ChunkedArray<T>
impl<T> MetadataCollectable<T> for ChunkedArray<T>
fn collect_cheap_metadata(&mut self)
fn with_cheap_metadata(self) -> Self
source§impl<T: PolarsNumericType, N: Num + ToPrimitive> Mul<N> for &ChunkedArray<T>
impl<T: PolarsNumericType, N: Num + ToPrimitive> Mul<N> for &ChunkedArray<T>
source§impl<T: PolarsNumericType, N: Num + ToPrimitive> Mul<N> for ChunkedArray<T>
impl<T: PolarsNumericType, N: Num + ToPrimitive> Mul<N> for ChunkedArray<T>
source§impl<T: PolarsNumericType> Mul for &ChunkedArray<T>
impl<T: PolarsNumericType> Mul for &ChunkedArray<T>
source§impl<T: PolarsNumericType> Mul for ChunkedArray<T>
impl<T: PolarsNumericType> Mul for ChunkedArray<T>
source§impl NamedFrom<Range<u32>, UInt32Type> for ChunkedArray<UInt32Type>
impl NamedFrom<Range<u32>, UInt32Type> for ChunkedArray<UInt32Type>
source§impl NamedFrom<Range<u64>, UInt64Type> for ChunkedArray<UInt64Type>
impl NamedFrom<Range<u64>, UInt64Type> for ChunkedArray<UInt64Type>
source§impl<T: AsRef<[Option<String>]>> NamedFrom<T, [Option<String>]> for ChunkedArray<StringType>
impl<T: AsRef<[Option<String>]>> NamedFrom<T, [Option<String>]> for ChunkedArray<StringType>
source§impl<T: AsRef<[Option<Vec<u8>>]>> NamedFrom<T, [Option<Vec<u8>>]> for ChunkedArray<BinaryType>
impl<T: AsRef<[Option<Vec<u8>>]>> NamedFrom<T, [Option<Vec<u8>>]> for ChunkedArray<BinaryType>
source§impl<T: AsRef<[Option<bool>]>> NamedFrom<T, [Option<bool>]> for ChunkedArray<BooleanType>
impl<T: AsRef<[Option<bool>]>> NamedFrom<T, [Option<bool>]> for ChunkedArray<BooleanType>
source§impl<T: AsRef<[Option<f32>]>> NamedFrom<T, [Option<f32>]> for ChunkedArray<Float32Type>
impl<T: AsRef<[Option<f32>]>> NamedFrom<T, [Option<f32>]> for ChunkedArray<Float32Type>
source§impl<T: AsRef<[Option<f64>]>> NamedFrom<T, [Option<f64>]> for ChunkedArray<Float64Type>
impl<T: AsRef<[Option<f64>]>> NamedFrom<T, [Option<f64>]> for ChunkedArray<Float64Type>
source§impl<T: AsRef<[Option<u32>]>> NamedFrom<T, [Option<u32>]> for ChunkedArray<UInt32Type>
impl<T: AsRef<[Option<u32>]>> NamedFrom<T, [Option<u32>]> for ChunkedArray<UInt32Type>
source§impl<T: AsRef<[Option<u64>]>> NamedFrom<T, [Option<u64>]> for ChunkedArray<UInt64Type>
impl<T: AsRef<[Option<u64>]>> NamedFrom<T, [Option<u64>]> for ChunkedArray<UInt64Type>
source§impl<T: AsRef<[String]>> NamedFrom<T, [String]> for ChunkedArray<StringType>
impl<T: AsRef<[String]>> NamedFrom<T, [String]> for ChunkedArray<StringType>
source§impl<T: AsRef<[Vec<u8>]>> NamedFrom<T, [Vec<u8>]> for ChunkedArray<BinaryType>
impl<T: AsRef<[Vec<u8>]>> NamedFrom<T, [Vec<u8>]> for ChunkedArray<BinaryType>
source§impl<T: AsRef<[bool]>> NamedFrom<T, [bool]> for ChunkedArray<BooleanType>
impl<T: AsRef<[bool]>> NamedFrom<T, [bool]> for ChunkedArray<BooleanType>
source§impl<T: AsRef<[f32]>> NamedFrom<T, [f32]> for ChunkedArray<Float32Type>
impl<T: AsRef<[f32]>> NamedFrom<T, [f32]> for ChunkedArray<Float32Type>
source§impl<T: AsRef<[f64]>> NamedFrom<T, [f64]> for ChunkedArray<Float64Type>
impl<T: AsRef<[f64]>> NamedFrom<T, [f64]> for ChunkedArray<Float64Type>
source§impl<T: AsRef<[u32]>> NamedFrom<T, [u32]> for ChunkedArray<UInt32Type>
impl<T: AsRef<[u32]>> NamedFrom<T, [u32]> for ChunkedArray<UInt32Type>
source§impl<T: AsRef<[u64]>> NamedFrom<T, [u64]> for ChunkedArray<UInt64Type>
impl<T: AsRef<[u64]>> NamedFrom<T, [u64]> for ChunkedArray<UInt64Type>
source§impl<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,
source§fn 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
source§fn 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>
source§impl<T: NumOpsDispatchInner> NumOpsDispatch for ChunkedArray<T>
impl<T: NumOpsDispatchInner> NumOpsDispatch for ChunkedArray<T>
fn subtract(&self, rhs: &Series) -> PolarsResult<Series>
fn add_to(&self, rhs: &Series) -> PolarsResult<Series>
fn multiply(&self, rhs: &Series) -> PolarsResult<Series>
fn divide(&self, rhs: &Series) -> PolarsResult<Series>
fn remainder(&self, rhs: &Series) -> PolarsResult<Series>
source§impl<S: NumOpsDispatchCheckedInner> NumOpsDispatchChecked for ChunkedArray<S>
Available on crate feature checked_arithmetic
only.
impl<S: NumOpsDispatchCheckedInner> NumOpsDispatchChecked for ChunkedArray<S>
checked_arithmetic
only.source§fn checked_div(&self, rhs: &Series) -> PolarsResult<Series>
fn checked_div(&self, rhs: &Series) -> PolarsResult<Series>
fn checked_div_num<T: ToPrimitive>(&self, rhs: T) -> PolarsResult<Series>
source§impl<T> QuantileAggSeries for ChunkedArray<T>
impl<T> QuantileAggSeries for ChunkedArray<T>
source§fn quantile_reduce(
&self,
quantile: f64,
interpol: QuantileInterpolOptions
) -> PolarsResult<Scalar>
fn quantile_reduce( &self, quantile: f64, interpol: QuantileInterpolOptions ) -> PolarsResult<Scalar>
ChunkedArray
as a new Series
of length 1.source§fn median_reduce(&self) -> Scalar
fn median_reduce(&self) -> Scalar
ChunkedArray
as a new Series
of length 1.source§impl<T: PolarsNumericType, N: Num + ToPrimitive> Rem<N> for &ChunkedArray<T>
impl<T: PolarsNumericType, N: Num + ToPrimitive> Rem<N> for &ChunkedArray<T>
source§impl<T: PolarsNumericType, N: Num + ToPrimitive> Rem<N> for ChunkedArray<T>
impl<T: PolarsNumericType, N: Num + ToPrimitive> Rem<N> for ChunkedArray<T>
source§impl<T: PolarsNumericType> Rem for &ChunkedArray<T>
impl<T: PolarsNumericType> Rem for &ChunkedArray<T>
source§impl<T: PolarsNumericType> Rem for ChunkedArray<T>
impl<T: PolarsNumericType> Rem for ChunkedArray<T>
source§impl<T: PolarsNumericType, N: Num + ToPrimitive> Sub<N> for &ChunkedArray<T>
impl<T: PolarsNumericType, N: Num + ToPrimitive> Sub<N> for &ChunkedArray<T>
source§impl<T: PolarsNumericType, N: Num + ToPrimitive> Sub<N> for ChunkedArray<T>
impl<T: PolarsNumericType, N: Num + ToPrimitive> Sub<N> for ChunkedArray<T>
source§impl<T: PolarsNumericType> Sub for &ChunkedArray<T>
impl<T: PolarsNumericType> Sub for &ChunkedArray<T>
source§impl<T: PolarsNumericType> Sub for ChunkedArray<T>
impl<T: PolarsNumericType> Sub for ChunkedArray<T>
source§impl<T> VarAggSeries for ChunkedArray<T>
impl<T> VarAggSeries for ChunkedArray<T>
source§fn var_reduce(&self, ddof: u8) -> Scalar
fn var_reduce(&self, ddof: u8) -> Scalar
ChunkedArray
as a new Series
of length 1.source§fn std_reduce(&self, ddof: u8) -> Scalar
fn std_reduce(&self, ddof: u8) -> Scalar
ChunkedArray
as a new Series
of length 1.Auto Trait Implementations§
impl<T> Freeze for ChunkedArray<T>
impl<T> !RefUnwindSafe for ChunkedArray<T>
impl<T> Send for ChunkedArray<T>
impl<T> Sync for ChunkedArray<T>
impl<T> Unpin for ChunkedArray<T>
impl<T> !UnwindSafe for ChunkedArray<T>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<A, T, E> FromFallibleIterator<A, E> for Twhere
T: FromIterator<A>,
E: Error,
impl<A, T, E> FromFallibleIterator<A, E> for Twhere
T: FromIterator<A>,
E: Error,
fn from_fallible_iter<F>(iter: F) -> Result<T, E>where
F: FallibleIterator<E, Item = A>,
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more