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(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) -> PolarsResult<&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 ChunkedArray::rechunk after multiple append operations.
See also ChunkedArray::extend
for appends within a chunk.
Implementations§
source§impl<T: PolarsNumericType> ChunkedArray<T>where
T::Native: Signed,
impl<T: PolarsNumericType> ChunkedArray<T>where
T::Native: Signed,
source§impl<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
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>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.
source§impl<T: PolarsNumericType> ChunkedArray<T>
impl<T: PolarsNumericType> ChunkedArray<T>
source§impl<T: PolarsDataType> ChunkedArray<T>
impl<T: PolarsDataType> ChunkedArray<T>
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
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 ChunkedArray<ListType>
impl ChunkedArray<ListType>
pub fn full_null_with_dtype(
name: &str,
length: usize,
inner_dtype: &DataType
) -> ListChunked
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_apply_float<F>(
&self,
window_size: usize,
f: F
) -> PolarsResult<Self>where
F: FnMut(&mut ChunkedArray<T>) -> Option<T::Native>,
Available on crate feature rolling_window
only.
pub fn rolling_apply_float<F>(
&self,
window_size: usize,
f: F
) -> PolarsResult<Self>where
F: FnMut(&mut ChunkedArray<T>) -> Option<T::Native>,
rolling_window
only.Apply a rolling custom function. This is pretty slow because of dynamic dispatch.
source§impl<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.
source§impl ChunkedArray<ListType>
impl ChunkedArray<ListType>
pub fn par_iter(&self) -> impl ParallelIterator<Item = Option<Series>> + '_
pub fn par_iter_indexed(
&mut self
) -> impl IndexedParallelIterator<Item = Option<Series>> + '_
source§impl 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>> + '_
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>where
T: PolarsDataType,
impl<T> ChunkedArray<T>where
T: PolarsDataType,
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
.
source§impl<T> ChunkedArray<T>where
T: PolarsNumericType,
impl<T> ChunkedArray<T>where
T: PolarsNumericType,
source§impl ChunkedArray<ListType>
impl ChunkedArray<ListType>
sourcepub fn amortized_iter(
&self
) -> AmortizedListIter<'_, impl Iterator<Item = Option<ArrayBox>> + '_>
Available on crate feature private
only.
pub fn amortized_iter(
&self
) -> AmortizedListIter<'_, impl Iterator<Item = Option<ArrayBox>> + '_>
private
only.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) -> Selfwhere
F: FnMut(UnstableSeries<'a>) -> Series,
Available on crate feature private
only.
pub fn apply_amortized<'a, F>(&'a self, f: F) -> Selfwhere
F: FnMut(UnstableSeries<'a>) -> Series,
private
only.Apply a closure F
elementwise.
pub fn try_apply_amortized<'a, F>(&'a self, f: F) -> PolarsResult<Self>where
F: FnMut(UnstableSeries<'a>) -> PolarsResult<Series>,
source§impl ChunkedArray<ListType>
impl ChunkedArray<ListType>
pub fn set_fast_explode(&mut self)
private
only.pub fn _can_fast_explode(&self) -> bool
pub fn to_logical(&mut self, inner_dtype: DataType)
source§impl ChunkedArray<Int32Type>
impl ChunkedArray<Int32Type>
pub fn into_date(self) -> DateChunked
dtype-date
only.source§impl ChunkedArray<Int64Type>
impl ChunkedArray<Int64Type>
pub fn into_datetime(
self,
timeunit: TimeUnit,
tz: Option<TimeZone>
) -> DatetimeChunked
dtype-datetime
only.source§impl ChunkedArray<Int64Type>
impl ChunkedArray<Int64Type>
pub fn into_duration(self, timeunit: TimeUnit) -> DurationChunked
dtype-duration
only.source§impl ChunkedArray<Int64Type>
impl ChunkedArray<Int64Type>
pub fn into_time(self) -> TimeChunked
dtype-time
only.source§impl<T> ChunkedArray<ObjectType<T>>where
T: PolarsObject,
impl<T> ChunkedArray<ObjectType<T>>where
T: PolarsObject,
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>where
T: PolarsNumericType,
Standard: Distribution<T::Native>,
impl<T> ChunkedArray<T>where
T: PolarsNumericType,
Standard: Distribution<T::Native>,
source§impl<T> ChunkedArray<T>where
T: PolarsDataType,
ChunkedArray<T>: ChunkTake,
impl<T> ChunkedArray<T>where
T: PolarsDataType,
ChunkedArray<T>: ChunkTake,
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>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
) -> 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.
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 ChunkedArray<Utf8Type>
impl ChunkedArray<Utf8Type>
pub fn hex_decode(&self) -> PolarsResult<Utf8Chunked>
string_encoding
and non-crate feature binary_encoding
only.pub fn hex_encode(&self) -> Utf8Chunked
string_encoding
only.pub fn base64_decode(&self) -> PolarsResult<Utf8Chunked>
string_encoding
and non-crate feature binary_encoding
only.pub fn base64_encode(&self) -> Utf8Chunked
string_encoding
only.source§impl<T: PolarsDataType> ChunkedArray<T>
impl<T: PolarsDataType> ChunkedArray<T>
pub fn is_sorted_flag2(&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 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.
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.
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
sourcepub fn chunk_id(&self) -> ChunkIdIter<'_>
pub fn chunk_id(&self) -> ChunkIdIter<'_>
Unique id representing the number of chunks
sourcepub unsafe fn chunks_mut(&mut self) -> &mut Vec<ArrayRef> ⓘ
pub unsafe fn chunks_mut(&mut self) -> &mut Vec<ArrayRef> ⓘ
A mutable reference to the chunks
Safety
The caller must ensure to not change the DataType
or length
of any of 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 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
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]>
Contiguous slice
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
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)
source§impl<T: PolarsNumericType> ChunkedArray<T>
impl<T: PolarsNumericType> ChunkedArray<T>
source§impl<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§
source§impl Add<&ChunkedArray<BinaryType>> for &BinaryChunked
Available on crate feature dtype-binary
only.
impl Add<&ChunkedArray<BinaryType>> for &BinaryChunked
dtype-binary
only.§type Output = ChunkedArray<BinaryType>
type Output = ChunkedArray<BinaryType>
+
operator.source§impl<T> Add<&ChunkedArray<T>> for &ChunkedArray<T>where
T: PolarsNumericType,
impl<T> Add<&ChunkedArray<T>> for &ChunkedArray<T>where
T: PolarsNumericType,
source§impl Add<&ChunkedArray<Utf8Type>> for &Utf8Chunked
impl Add<&ChunkedArray<Utf8Type>> for &Utf8Chunked
source§impl Add<ChunkedArray<BinaryType>> for BinaryChunked
Available on crate feature dtype-binary
only.
impl Add<ChunkedArray<BinaryType>> for BinaryChunked
dtype-binary
only.§type Output = ChunkedArray<BinaryType>
type Output = ChunkedArray<BinaryType>
+
operator.source§impl<T> Add<ChunkedArray<T>> for ChunkedArray<T>where
T: PolarsNumericType,
impl<T> Add<ChunkedArray<T>> for ChunkedArray<T>where
T: PolarsNumericType,
source§impl Add<ChunkedArray<Utf8Type>> for Utf8Chunked
impl Add<ChunkedArray<Utf8Type>> for Utf8Chunked
source§impl<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,
source§impl<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,
source§impl<T> AggList for ChunkedArray<T>where
T: PolarsNumericType,
ChunkedArray<T>: IntoSeries,
impl<T> AggList for ChunkedArray<T>where
T: PolarsNumericType,
ChunkedArray<T>: IntoSeries,
source§impl<T> ArgAgg for ChunkedArray<T>where
T: PolarsNumericType,
impl<T> ArgAgg for ChunkedArray<T>where
T: PolarsNumericType,
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 BitAnd<&ChunkedArray<BooleanType>> for &BooleanChunked
impl BitAnd<&ChunkedArray<BooleanType>> for &BooleanChunked
§type Output = ChunkedArray<BooleanType>
type Output = ChunkedArray<BooleanType>
&
operator.source§impl<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>,
source§impl BitAnd<ChunkedArray<BooleanType>> for BooleanChunked
impl BitAnd<ChunkedArray<BooleanType>> for BooleanChunked
§type Output = ChunkedArray<BooleanType>
type Output = ChunkedArray<BooleanType>
&
operator.source§impl BitOr<&ChunkedArray<BooleanType>> for &BooleanChunked
impl BitOr<&ChunkedArray<BooleanType>> for &BooleanChunked
§type Output = ChunkedArray<BooleanType>
type Output = ChunkedArray<BooleanType>
|
operator.source§impl<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>,
source§impl BitOr<ChunkedArray<BooleanType>> for BooleanChunked
impl BitOr<ChunkedArray<BooleanType>> for BooleanChunked
§type Output = ChunkedArray<BooleanType>
type Output = ChunkedArray<BooleanType>
|
operator.source§impl BitXor<&ChunkedArray<BooleanType>> for &BooleanChunked
impl BitXor<&ChunkedArray<BooleanType>> for &BooleanChunked
§type Output = ChunkedArray<BooleanType>
type Output = ChunkedArray<BooleanType>
^
operator.source§impl<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>,
source§impl BitXor<ChunkedArray<BooleanType>> for BooleanChunked
impl BitXor<ChunkedArray<BooleanType>> for BooleanChunked
§type Output = ChunkedArray<BooleanType>
type Output = ChunkedArray<BooleanType>
^
operator.source§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>,
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>,
source§fn sum(&self) -> Option<T::Native>
fn sum(&self) -> Option<T::Native>
None
if the array is empty or only contains null values.fn min(&self) -> Option<T::Native>
source§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,
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,
source§fn sum_as_series(&self) -> Series
fn sum_as_series(&self) -> Series
source§fn max_as_series(&self) -> Series
fn max_as_series(&self) -> Series
source§fn min_as_series(&self) -> Series
fn min_as_series(&self) -> Series
source§fn prod_as_series(&self) -> Series
fn prod_as_series(&self) -> Series
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, <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,
source§fn 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,
source§fn 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,
source§fn apply<F>(&'a self, f: F) -> Selfwhere
F: Fn(T::Native) -> T::Native + Copy,
fn apply<F>(&'a self, f: F) -> Selfwhere
F: Fn(T::Native) -> T::Native + Copy,
fn try_apply<F>(&'a self, f: F) -> PolarsResult<Self>where
F: Fn(T::Native) -> PolarsResult<T::Native> + Copy,
source§fn apply_on_opt<F>(&'a self, f: F) -> Selfwhere
F: Fn(Option<T::Native>) -> Option<T::Native> + Copy,
fn apply_on_opt<F>(&'a self, f: F) -> Selfwhere
F: Fn(Option<T::Native>) -> Option<T::Native> + Copy,
source§fn apply_with_idx<F>(&'a self, f: F) -> Selfwhere
F: Fn((usize, T::Native)) -> T::Native + Copy,
fn apply_with_idx<F>(&'a self, f: F) -> Selfwhere
F: Fn((usize, T::Native)) -> T::Native + Copy,
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(&self, data_type: &DataType) -> PolarsResult<Series>
fn cast(&self, data_type: &DataType) -> PolarsResult<Series>
[ChunkedArray]
to [DataType]
source§fn cast_unchecked(&self, data_type: &DataType) -> PolarsResult<Series>
fn cast_unchecked(&self, data_type: &DataType) -> PolarsResult<Series>
source§impl ChunkCompare<&ChunkedArray<BinaryType>> for BinaryChunked
Available on crate feature dtype-binary
only.
impl ChunkCompare<&ChunkedArray<BinaryType>> for BinaryChunked
dtype-binary
only.type Item = ChunkedArray<BooleanType>
source§fn equal(&self, rhs: &BinaryChunked) -> BooleanChunked
fn equal(&self, rhs: &BinaryChunked) -> BooleanChunked
source§fn not_equal(&self, rhs: &BinaryChunked) -> BooleanChunked
fn not_equal(&self, rhs: &BinaryChunked) -> BooleanChunked
source§fn gt(&self, rhs: &BinaryChunked) -> BooleanChunked
fn gt(&self, rhs: &BinaryChunked) -> BooleanChunked
source§fn gt_eq(&self, rhs: &BinaryChunked) -> BooleanChunked
fn gt_eq(&self, rhs: &BinaryChunked) -> BooleanChunked
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§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 not_equal(&self, rhs: &BooleanChunked) -> BooleanChunked
fn not_equal(&self, rhs: &BooleanChunked) -> BooleanChunked
source§fn gt(&self, rhs: &BooleanChunked) -> BooleanChunked
fn gt(&self, rhs: &BooleanChunked) -> BooleanChunked
source§fn gt_eq(&self, rhs: &BooleanChunked) -> BooleanChunked
fn gt_eq(&self, rhs: &BooleanChunked) -> BooleanChunked
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§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 not_equal(&self, rhs: &ListChunked) -> BooleanChunked
fn not_equal(&self, rhs: &ListChunked) -> BooleanChunked
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<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>
source§fn equal(&self, rhs: &ChunkedArray<T>) -> BooleanChunked
fn equal(&self, rhs: &ChunkedArray<T>) -> BooleanChunked
source§fn not_equal(&self, rhs: &ChunkedArray<T>) -> BooleanChunked
fn not_equal(&self, rhs: &ChunkedArray<T>) -> BooleanChunked
source§fn gt(&self, rhs: &ChunkedArray<T>) -> BooleanChunked
fn gt(&self, rhs: &ChunkedArray<T>) -> BooleanChunked
source§fn gt_eq(&self, rhs: &ChunkedArray<T>) -> BooleanChunked
fn gt_eq(&self, rhs: &ChunkedArray<T>) -> BooleanChunked
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§impl ChunkCompare<&ChunkedArray<Utf8Type>> for Utf8Chunked
impl ChunkCompare<&ChunkedArray<Utf8Type>> for Utf8Chunked
type Item = ChunkedArray<BooleanType>
source§fn equal(&self, rhs: &Utf8Chunked) -> BooleanChunked
fn equal(&self, rhs: &Utf8Chunked) -> BooleanChunked
source§fn not_equal(&self, rhs: &Utf8Chunked) -> BooleanChunked
fn not_equal(&self, rhs: &Utf8Chunked) -> BooleanChunked
source§fn gt(&self, rhs: &Utf8Chunked) -> BooleanChunked
fn gt(&self, rhs: &Utf8Chunked) -> BooleanChunked
source§fn gt_eq(&self, rhs: &Utf8Chunked) -> BooleanChunked
fn gt_eq(&self, rhs: &Utf8Chunked) -> BooleanChunked
source§fn lt(&self, rhs: &Utf8Chunked) -> BooleanChunked
fn lt(&self, rhs: &Utf8Chunked) -> BooleanChunked
source§fn lt_eq(&self, rhs: &Utf8Chunked) -> BooleanChunked
fn lt_eq(&self, rhs: &Utf8Chunked) -> BooleanChunked
source§impl<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>
source§fn equal(&self, rhs: Rhs) -> BooleanChunked
fn equal(&self, rhs: Rhs) -> BooleanChunked
source§fn not_equal(&self, rhs: Rhs) -> BooleanChunked
fn not_equal(&self, rhs: Rhs) -> BooleanChunked
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> ChunkCumAgg<T> for ChunkedArray<T>where
T: PolarsNumericType,
ChunkedArray<T>: FromIterator<Option<T::Native>>,
Available on crate feature cum_agg
only.
impl<T> ChunkCumAgg<T> for ChunkedArray<T>where
T: PolarsNumericType,
ChunkedArray<T>: FromIterator<Option<T::Native>>,
cum_agg
only.source§fn cummax(&self, reverse: bool) -> ChunkedArray<T>
fn cummax(&self, reverse: bool) -> ChunkedArray<T>
source§fn cummin(&self, reverse: bool) -> ChunkedArray<T>
fn cummin(&self, reverse: bool) -> ChunkedArray<T>
source§fn cumsum(&self, reverse: bool) -> ChunkedArray<T>
fn cumsum(&self, reverse: bool) -> ChunkedArray<T>
source§fn cumprod(&self, reverse: bool) -> ChunkedArray<T>
fn cumprod(&self, reverse: bool) -> ChunkedArray<T>
source§impl<T> ChunkExpandAtIndex<T> for ChunkedArray<T>where
ChunkedArray<T>: ChunkFull<T::Native> + TakeRandom<Item = T::Native>,
T: PolarsNumericType + PolarsDataType,
impl<T> ChunkExpandAtIndex<T> for ChunkedArray<T>where
ChunkedArray<T>: ChunkFull<T::Native> + TakeRandom<Item = T::Native>,
T: PolarsNumericType + PolarsDataType,
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> 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>,
source§fn fill_null(&self, strategy: FillNullStrategy) -> PolarsResult<Self>
fn fill_null(&self, strategy: FillNullStrategy) -> PolarsResult<Self>
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> ChunkPeaks for ChunkedArray<T>where
T: PolarsNumericType,
impl<T> ChunkPeaks for ChunkedArray<T>where
T: PolarsNumericType,
source§fn peak_max(&self) -> BooleanChunked
fn peak_max(&self) -> BooleanChunked
Get a boolean mask of the local maximum peaks.
source§fn peak_min(&self) -> BooleanChunked
fn peak_min(&self) -> BooleanChunked
Get a boolean mask of the local minimum peaks.
source§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>,
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>,
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<T> for ChunkedArray<T>where
T: PolarsNumericType,
impl<T> ChunkReverse<T> 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_apply(
&self,
f: &dyn Fn(&Series) -> Series,
options: RollingOptionsFixedWindow
) -> PolarsResult<Series>
fn rolling_apply(
&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 set_at_idx<I: IntoIterator<Item = IdxSize>>(
&'a self,
idx: I,
value: Option<T::Native>
) -> PolarsResult<Self>
fn set_at_idx<I: IntoIterator<Item = IdxSize>>(
&'a self,
idx: I,
value: Option<T::Native>
) -> PolarsResult<Self>
source§fn set_at_idx_with<I: IntoIterator<Item = IdxSize>, F>(
&'a self,
idx: I,
f: F
) -> PolarsResult<Self>where
F: Fn(Option<T::Native>) -> Option<T::Native>,
fn set_at_idx_with<I: IntoIterator<Item = IdxSize>, F>(
&'a self,
idx: I,
f: F
) -> PolarsResult<Self>where
F: Fn(Option<T::Native>) -> Option<T::Native>,
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: PolarsIntegerType,
T::Native: Default + Ord,
impl<T> ChunkSort<T> for ChunkedArray<T>where
T: PolarsIntegerType,
T::Native: Default + Ord,
source§fn argsort_multiple(
&self,
other: &[Series],
reverse: &[bool]
) -> PolarsResult<IdxCa>
fn argsort_multiple(
&self,
other: &[Series],
reverse: &[bool]
) -> 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, reverse: bool) -> ChunkedArray<T>
fn sort(&self, reverse: bool) -> ChunkedArray<T>
ChunkedArray
.source§fn argsort(&self, options: SortOptions) -> IdxCa
fn argsort(&self, options: SortOptions) -> IdxCa
source§impl<T> ChunkTake for ChunkedArray<T>where
T: PolarsNumericType,
impl<T> ChunkTake for ChunkedArray<T>where
T: PolarsNumericType,
source§unsafe fn take_unchecked<I, INulls>(
&self,
indices: TakeIdx<'_, I, INulls>
) -> Selfwhere
Self: Sized,
I: TakeIterator,
INulls: TakeIteratorNulls,
unsafe fn take_unchecked<I, INulls>(
&self,
indices: TakeIdx<'_, I, INulls>
) -> Selfwhere
Self: Sized,
I: TakeIterator,
INulls: TakeIteratorNulls,
source§fn take<I, INulls>(&self, indices: TakeIdx<'_, I, INulls>) -> PolarsResult<Self>where
Self: Sized,
I: TakeIterator,
INulls: TakeIteratorNulls,
fn take<I, INulls>(&self, indices: TakeIdx<'_, I, INulls>) -> PolarsResult<Self>where
Self: Sized,
I: TakeIterator,
INulls: TakeIteratorNulls,
source§impl<T> ChunkTakeEvery<T> for ChunkedArray<T>where
T: PolarsNumericType,
impl<T> ChunkTakeEvery<T> for ChunkedArray<T>where
T: PolarsNumericType,
source§fn take_every(&self, n: usize) -> ChunkedArray<T>
fn take_every(&self, n: usize) -> ChunkedArray<T>
source§impl<T> ChunkUnique<T> for ChunkedArray<T>where
T: PolarsIntegerType,
T::Native: Hash + Eq + Ord,
ChunkedArray<T>: IntoSeries,
impl<T> ChunkUnique<T> for ChunkedArray<T>where
T: PolarsIntegerType,
T::Native: Hash + Eq + Ord,
ChunkedArray<T>: IntoSeries,
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 is_unique(&self) -> PolarsResult<BooleanChunked>
fn is_unique(&self) -> PolarsResult<BooleanChunked>
source§fn is_duplicated(&self) -> PolarsResult<BooleanChunked>
fn is_duplicated(&self) -> PolarsResult<BooleanChunked>
source§fn n_unique(&self) -> PolarsResult<usize>
fn n_unique(&self) -> PolarsResult<usize>
ChunkedArray
source§fn mode(&self) -> PolarsResult<Self>
fn mode(&self) -> PolarsResult<Self>
mode
only.source§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>,
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>,
source§impl<T> ChunkZip<T> for ChunkedArray<T>where
T: PolarsNumericType,
Available on crate feature zip_with
only.
impl<T> ChunkZip<T> for ChunkedArray<T>where
T: PolarsNumericType,
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 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> Div<&ChunkedArray<T>> for &ChunkedArray<T>where
T: PolarsNumericType,
impl<T> Div<&ChunkedArray<T>> for &ChunkedArray<T>where
T: PolarsNumericType,
source§impl<T> Div<ChunkedArray<T>> for ChunkedArray<T>where
T: PolarsNumericType,
impl<T> Div<ChunkedArray<T>> for ChunkedArray<T>where
T: PolarsNumericType,
source§impl<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,
source§impl<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,
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> From<&'a ChunkedArray<BooleanType>> for Vec<Option<bool>>
impl<'a> From<&'a ChunkedArray<BooleanType>> for Vec<Option<bool>>
source§fn from(ca: &'a BooleanChunked) -> Self
fn from(ca: &'a BooleanChunked) -> Self
source§impl<'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,
source§fn from(ca: &'a ChunkedArray<T>) -> Self
fn from(ca: &'a ChunkedArray<T>) -> Self
source§impl<'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
source§impl<'a> From<&'a ChunkedArray<Utf8Type>> for Vec<Option<&'a str>>
impl<'a> From<&'a ChunkedArray<Utf8Type>> for Vec<Option<&'a str>>
From trait
source§fn from(ca: &'a Utf8Chunked) -> Self
fn from(ca: &'a Utf8Chunked) -> Self
source§impl<T: PolarsNumericType> From<&[<T as PolarsNumericType>::Native]> for ChunkedArray<T>
impl<T: PolarsNumericType> From<&[<T as PolarsNumericType>::Native]> for ChunkedArray<T>
source§impl<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>
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<Int32Type>> for DateChunked
Available on crate feature dtype-date
only.
impl From<ChunkedArray<Int32Type>> for DateChunked
dtype-date
only.source§fn from(ca: Int32Chunked) -> Self
fn from(ca: Int32Chunked) -> Self
source§impl From<ChunkedArray<Int64Type>> for TimeChunked
Available on crate feature dtype-time
only.
impl From<ChunkedArray<Int64Type>> for TimeChunked
dtype-time
only.source§fn from(ca: Int64Chunked) -> Self
fn from(ca: Int64Chunked) -> Self
source§impl<T> From<ChunkedArray<T>> for Serieswhere
T: PolarsDataType,
ChunkedArray<T>: IntoSeries,
impl<T> From<ChunkedArray<T>> for Serieswhere
T: PolarsDataType,
ChunkedArray<T>: IntoSeries,
source§fn from(ca: ChunkedArray<T>) -> Self
fn from(ca: ChunkedArray<T>) -> Self
source§impl From<ChunkedArray<Utf8Type>> for Vec<Option<String>>
impl From<ChunkedArray<Utf8Type>> for Vec<Option<String>>
source§fn from(ca: Utf8Chunked) -> Self
fn from(ca: Utf8Chunked) -> Self
source§impl<T: PolarsNumericType> From<PrimitiveArray<<T as PolarsNumericType>::Native>> for ChunkedArray<T>
impl<T: PolarsNumericType> From<PrimitiveArray<<T as PolarsNumericType>::Native>> for ChunkedArray<T>
source§fn from(a: PrimitiveArray<T::Native>) -> Self
fn from(a: PrimitiveArray<T::Native>) -> Self
source§impl<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,
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§fn 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
par_iter
. Read moresource§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
) -> Self
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>where
T: PolarsNumericType,
T::Native: NumCast,
impl<T> IntoGroupsProxy for ChunkedArray<T>where
T: PolarsNumericType,
T::Native: NumCast,
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, Global>
type IntoIter = Box<dyn PolarsIterator<Item = <&'a ChunkedArray<T> as IntoIterator>::Item> + 'a, Global>
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<'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>>
source§fn take_rand(&self) -> Self::TakeRandom
fn take_rand(&self) -> Self::TakeRandom
TakeRandom
.source§impl<T> IsFirst<T> for ChunkedArray<T>where
T: PolarsNumericType,
Available on crate feature is_first
only.
impl<T> IsFirst<T> for ChunkedArray<T>where
T: PolarsNumericType,
is_first
only.fn is_first(&self) -> PolarsResult<BooleanChunked>
source§impl<T> IsIn for ChunkedArray<T>where
T: PolarsNumericType,
Available on crate feature is_in
only.
impl<T> IsIn for ChunkedArray<T>where
T: PolarsNumericType,
is_in
only.source§fn is_in(&self, other: &Series) -> PolarsResult<BooleanChunked>
fn is_in(&self, other: &Series) -> PolarsResult<BooleanChunked>
source§impl<T> Mul<&ChunkedArray<T>> for &ChunkedArray<T>where
T: PolarsNumericType,
impl<T> Mul<&ChunkedArray<T>> for &ChunkedArray<T>where
T: PolarsNumericType,
source§impl<T> Mul<ChunkedArray<T>> for ChunkedArray<T>where
T: PolarsNumericType,
impl<T> Mul<ChunkedArray<T>> for ChunkedArray<T>where
T: PolarsNumericType,
source§impl<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,
source§impl<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,
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<Vec<u8>>]>> NamedFrom<T, [Option<Vec<u8, Global>>]> for ChunkedArray<BinaryType>
impl<T: AsRef<[Option<Vec<u8>>]>> NamedFrom<T, [Option<Vec<u8, Global>>]> 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<u16>]>> NamedFrom<T, [Option<u16>]> for ChunkedArray<UInt16Type>
impl<T: AsRef<[Option<u16>]>> NamedFrom<T, [Option<u16>]> for ChunkedArray<UInt16Type>
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<[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<[u16]>> NamedFrom<T, [u16]> for ChunkedArray<UInt16Type>
impl<T: AsRef<[u16]>> NamedFrom<T, [u16]> for ChunkedArray<UInt16Type>
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> NumOpsDispatch for ChunkedArray<T>where
T: PolarsNumericType,
ChunkedArray<T>: IntoSeries,
impl<T> NumOpsDispatch for ChunkedArray<T>where
T: PolarsNumericType,
ChunkedArray<T>: IntoSeries,
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<T> NumOpsDispatchChecked for ChunkedArray<T>where
T: PolarsIntegerType,
T::Native: CheckedDiv<Output = T::Native> + Zero + One,
ChunkedArray<T>: IntoSeries,
Available on crate feature checked_arithmetic
only.
impl<T> NumOpsDispatchChecked for ChunkedArray<T>where
T: PolarsIntegerType,
T::Native: CheckedDiv<Output = T::Native> + Zero + One,
ChunkedArray<T>: IntoSeries,
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>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>,
source§fn quantile_as_series(
&self,
quantile: f64,
interpol: QuantileInterpolOptions
) -> PolarsResult<Series>
fn quantile_as_series(
&self,
quantile: f64,
interpol: QuantileInterpolOptions
) -> PolarsResult<Series>
source§fn median_as_series(&self) -> Series
fn median_as_series(&self) -> Series
source§impl<T> Rem<&ChunkedArray<T>> for &ChunkedArray<T>where
T: PolarsNumericType,
impl<T> Rem<&ChunkedArray<T>> for &ChunkedArray<T>where
T: PolarsNumericType,
source§impl<T> Rem<ChunkedArray<T>> for ChunkedArray<T>where
T: PolarsNumericType,
impl<T> Rem<ChunkedArray<T>> for ChunkedArray<T>where
T: PolarsNumericType,
source§impl<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,
source§impl<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,
source§impl<T> RepeatBy for ChunkedArray<T>where
T: PolarsNumericType,
Available on crate feature repeat_by
only.
impl<T> RepeatBy for ChunkedArray<T>where
T: PolarsNumericType,
repeat_by
only.source§fn repeat_by(&self, by: &IdxCa) -> ListChunked
fn repeat_by(&self, by: &IdxCa) -> ListChunked
n
times, where n
is determined by the values in by
.source§impl<T> StrConcat for ChunkedArray<T>where
T: PolarsNumericType,
T::Native: Display,
Available on crate feature concat_str
only.
impl<T> StrConcat for ChunkedArray<T>where
T: PolarsNumericType,
T::Native: Display,
concat_str
only.