Struct polars_core::chunked_array::ChunkedArray [−][src]
pub struct ChunkedArray<T> { /* fields omitted */ }
Expand description
ChunkedArray
Every Series contains a ChunkedArray<T>
. Unlike Series, ChunkedArray’s are typed. This allows
us to apply closures to the data and collect the results to a ChunkedArray
of the same type T
.
Below we use an apply to use the cosine function to the values of a ChunkedArray
.
fn apply_cosine(ca: &Float32Chunked) -> Float32Chunked {
ca.apply(|v| v.cos())
}
If we would like to cast the result we could use a Rust Iterator instead of an apply
method.
Note that Iterators are slightly slower as the null values aren’t ignored implicitly.
fn apply_cosine_and_cast(ca: &Float32Chunked) -> Float64Chunked {
ca.into_iter()
.map(|opt_v| {
opt_v.map(|v| v.cos() as f64)
}).collect()
}
Another option is to first cast and then use an apply.
fn apply_cosine_and_cast(ca: &Float32Chunked) -> Float64Chunked {
ca.apply_cast_numeric(|v| v.cos() as f64)
}
Conversion between Series and ChunkedArray’s
Conversion from a Series
to a ChunkedArray
is effortless.
fn to_chunked_array(series: &Series) -> Result<&Int32Chunked>{
series.i32()
}
fn to_series(ca: Int32Chunked) -> Series {
ca.into_series()
}
Iterators
ChunkedArrays
fully support Rust native Iterator
and DoubleEndedIterator traits, thereby
giving access to all the excellent methods available for Iterators.
fn iter_forward(ca: &Float32Chunked) {
ca.into_iter()
.for_each(|opt_v| println!("{:?}", opt_v))
}
fn iter_backward(ca: &Float32Chunked) {
ca.into_iter()
.rev()
.for_each(|opt_v| println!("{:?}", opt_v))
}
Memory layout
ChunkedArray
’s use Apache Arrow as backend for the memory layout.
Arrows memory is immutable which makes it possible to make multiple zero copy (sub)-views from a single array.
To be able to append data, Polars uses chunks to append new memory locations, hence the ChunkedArray<T>
data structure.
Appends are cheap, because it will not lead to a full reallocation of the whole array (as could be the case with a Rust Vec).
However, multiple chunks in a ChunkArray
will slow down the Iterators, arithmetic and other operations.
When multiplying two ChunkArray'
s with different chunk sizes they cannot utilize SIMD for instance.
However, when chunk size don’t match, Iterators will be used to do the operation (instead of arrows upstream implementation, which may utilize SIMD) and
the result will be a single chunked array.
The key takeaway is that by applying operations on a ChunkArray
of multiple chunks, the results will converge to
a ChunkArray
of a single chunk! It is recommended to leave them as is. If you want to have predictable performance
(no unexpected re-allocation of memory), it is advised to call the rechunk after
multiple append operations.
Implementations
pub fn downcast_iter(
&self
) -> impl Iterator<Item = &PrimitiveArray<T::Native>> + DoubleEndedIterator
object
only.object
only.impl<T> ChunkedArray<T> where
T: PolarsNumericType,
T::Native: Float,
ChunkedArray<T>: IntoSeries,
impl<T> ChunkedArray<T> where
T: PolarsNumericType,
T::Native: Float,
ChunkedArray<T>: IntoSeries,
This is supported on crate feature rolling_window
only.
rolling_window
only.Apply a rolling mean (moving mean) over the values in this array.
A window of length window_size
will traverse the array. The values that fill this window
will (optionally) be multiplied with the weights given by the weights
vector. The resulting
values will be aggregated to their mean.
This is supported on crate feature rolling_window
only.
rolling_window
only.Apply a rolling sum (moving sum) over the values in this array.
A window of length window_size
will traverse the array. The values that fill this window
will (optionally) be multiplied with the weights given by the weights
vector. The resulting
values will be aggregated to their sum.
This is supported on crate feature rolling_window
only.
rolling_window
only.Apply a rolling min (moving min) over the values in this array.
A window of length window_size
will traverse the array. The values that fill this window
will (optionally) be multiplied with the weights given by the weights
vector. The resulting
values will be aggregated to their min.
This is supported on crate feature rolling_window
only.
rolling_window
only.Apply a rolling max (moving max) over the values in this array.
A window of length window_size
will traverse the array. The values that fill this window
will (optionally) be multiplied with the weights given by the weights
vector. The resulting
values will be aggregated to their max.
impl<T> ChunkedArray<T> where
ChunkedArray<T>: IntoSeries,
T: PolarsFloatType,
T::Native: Float,
impl<T> ChunkedArray<T> where
ChunkedArray<T>: IntoSeries,
T: PolarsFloatType,
T::Native: Float,
pub fn rolling_apply_float<F>(&self, window_size: usize, f: F) -> Result<Self> where
F: Fn(&ChunkedArray<T>) -> Option<T::Native>,
This is supported on crate feature rolling_window
only.
pub fn rolling_apply_float<F>(&self, window_size: usize, f: F) -> Result<Self> where
F: Fn(&ChunkedArray<T>) -> Option<T::Native>,
rolling_window
only.Apply a rolling custom function. This is pretty slow because of dynamic dispatch.
This is supported on crate feature rolling_window
only.
rolling_window
only.Apply a rolling var (moving var) over the values in this array.
A window of length window_size
will traverse the array. The values that fill this window
will (optionally) be multiplied with the weights given by the weights
vector. The resulting
values will be aggregated to their var.
This is supported on crate feature rolling_window
only.
rolling_window
only.Apply a rolling std (moving std) over the values in this array.
A window of length window_size
will traverse the array. The values that fill this window
will (optionally) be multiplied with the weights given by the weights
vector. The resulting
values will be aggregated to their std.
pub fn into_no_null_iter(
&self
) -> impl Iterator<Item = bool> + '_ + Send + Sync + ExactSizeIterator + DoubleEndedIterator + TrustedLen
pub fn into_no_null_iter<'a>(
&'a self
) -> impl Iterator<Item = &'a str> + '_ + Send + Sync + ExactSizeIterator + DoubleEndedIterator + TrustedLen
pub fn into_no_null_iter(
&self
) -> impl Iterator<Item = Series> + '_ + Send + Sync + ExactSizeIterator + DoubleEndedIterator + TrustedLen
pub fn into_no_null_iter(
&self
) -> impl Iterator<Item = &T> + '_ + Send + Sync + ExactSizeIterator + DoubleEndedIterator + TrustedLen
object
only.pub fn into_no_null_iter(
&self
) -> impl Iterator<Item = u32> + '_ + Send + Sync + ExactSizeIterator + DoubleEndedIterator + TrustedLen
dtype-categorical
only.This is supported on crate feature ndarray
only.
ndarray
only.If data is aligned in a single chunk and has no Null values a zero copy view is returned
as an ndarray
This is supported on crate feature ndarray
only.
ndarray
only.If all nested Series
have the same length, a 2 dimensional ndarray::Array
is returned.
object
only.This is supported on crate feature object
only.
object
only.Get a hold to an object that can be formatted or downcasted via the Any trait.
Safety
No bounds checks
This is supported on crate feature object
only.
object
only.Get a hold to an object that can be formatted or downcasted via the Any trait.
This is supported on crate feature random
only.
random
only.Sample n datapoints from this ChunkedArray.
This is supported on crate feature random
only.
random
only.Sample a fraction between 0.0-1.0 of this ChunkedArray.
This is supported on crate feature random
only.
random
only.Create ChunkedArray
with samples from a Normal distribution.
This is supported on crate feature random
only.
random
only.Create ChunkedArray
with samples from a Standard Normal distribution.
This is supported on crate features strings
and extract_jsonpath
only.
strings
and extract_jsonpath
only.Extract json path, first match Refer to https://goessner.net/articles/JsonPath/
This is supported on crate feature strings
only.
strings
only.Get the length of the string values.
This is supported on crate feature strings
only.
strings
only.Check if strings contain a regex pattern
This is supported on crate feature strings
only.
strings
only.Replace the leftmost (sub)string by a regex pattern
This is supported on crate feature strings
only.
strings
only.Replace all (sub)strings by a regex pattern
This is supported on crate feature strings
only.
strings
only.Extract the nth capture group from pattern
This is supported on crate feature strings
only.
strings
only.Modify the strings to their lowercase equivalent
This is supported on crate feature strings
only.
strings
only.Modify the strings to their uppercase equivalent
This is supported on crate feature strings
only.
strings
only.Concat with the values from a second Utf8Chunked
This is supported on crate feature strings
only.
strings
only.Slice the string values
Determines a substring starting from start
and with optional length length
of each of the elements in array
.
start
can be negative, in which case the start counts from the end of the string.
temporal
and dtype-datetime
only.This is supported on crate feature dtype-categorical
only.
dtype-categorical
only.Get a reference to the mapping of categorical types to the string values.
pub fn amortized_iter(
&self
) -> AmortizedListIter<'_, impl Iterator<Item = Option<Box<dyn Array>>> + '_>
This is supported on crate feature private
only.
pub fn amortized_iter(
&self
) -> AmortizedListIter<'_, impl Iterator<Item = Option<Box<dyn Array>>> + '_>
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.
pub fn apply_amortized<'a, F>(&'a self, f: F) -> Self where
F: Fn(UnsafeSeries<'a>) -> Series + Copy,
This is supported on crate feature private
only.
pub fn apply_amortized<'a, F>(&'a self, f: F) -> Self where
F: Fn(UnsafeSeries<'a>) -> Series + Copy,
private
only.Apply a closure F
elementwise.
list
only.list
only.list
only.list
only.list
only.list
only.list
only.list
only.list
only.Get the index of the first non null value in this ChunkedArray.
Get the buffer of bits representing null values
Shrink the capacity of this array to fit it’s length.
Series to ChunkedArray
Unique id representing the number of chunks
Returns true if contains a single chunk and has no null values
Count the null values.
Append arrow array in place.
let mut array = Int32Chunked::new_from_slice("array", &[1, 2]);
let array_2 = Int32Chunked::new_from_slice("2nd", &[3]);
array.append(&array_2);
assert_eq!(Vec::from(&array), [Some(1), Some(2), Some(3)])
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
Get a mask of the null values.
Get a mask of the valid values.
Create a new ChunkedArray from existing chunks.
Create a new ChunkedArray by taking ownership of the AlignedVec. This operation is zero copy.
pub fn new_from_owned_with_null_bitmap(
name: &str,
values: AlignedVec<T::Native>,
buffer: Option<Bitmap>
) -> Self
pub fn new_from_owned_with_null_bitmap(
name: &str,
values: AlignedVec<T::Native>,
buffer: Option<Bitmap>
) -> Self
Nullify values in slice with an existing null bitmap
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
Get the inner data type of the list.
We cannot override the left hand side behaviour. So we create a trait LhsNumOps. This allows for 1.add(&Series)
Trait Implementations
Performs the conversion.
Performs the conversion.
Performs the conversion.
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>,
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>,
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>,
Aggregate the sum of the ChunkedArray.
Returns None
if the array is empty or only contains null values. Read more
Returns the maximum value in the array, according to the natural order.
Returns None
if the array is empty or only contains null values. Read more
Returns the mean value in the array.
Returns None
if the array is empty or only contains null values. Read more
Returns the mean value in the array.
Returns None
if the array is empty or only contains null values. Read more
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,
Get the sum of the ChunkedArray as a new Series of length 1.
Get the max of the ChunkedArray as a new Series of length 1.
Get the min of the ChunkedArray as a new Series of length 1.
Get the mean of the ChunkedArray as a new Series of length 1.
Get the median of the ChunkedArray as a new Series of length 1.
Get the quantile of the ChunkedArray as a new Series of length 1.
Get a single value. Beware this is slow. If you need to use this slightly performant, cast Categorical to UInt32 Read more
Get a single value. Beware this is slow.
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,
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,
Apply a closure elementwise and cast to a Numeric ChunkedArray. This is fastest when the null check branching is more expensive than the closure application. Read more
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,
Apply a closure on optional values and cast to Numeric ChunkedArray without null values.
Apply a closure elementwise. This is fastest when the null check branching is more expensive than the closure application. Often it is. Read more
Apply a closure elementwise including null values.
Apply a closure elementwise. The closure gets the index of the element as first argument.
Apply a closure elementwise. The closure gets the index of the element as first argument.
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,
Apply kernel and return result as a new ChunkedArray.
fn apply_kernel_cast<F, S>(&self, f: F) -> ChunkedArray<S> where
F: Fn(&PrimitiveArray<T::Native>) -> ArrayRef,
S: PolarsDataType,
fn apply_kernel_cast<F, S>(&self, f: F) -> ChunkedArray<S> where
F: Fn(&PrimitiveArray<T::Native>) -> ArrayRef,
S: PolarsDataType,
Apply a kernel that outputs an array of different type.
Check for equality and regard missing values as equal.
Check for equality.
Check for inequality.
Greater than comparison.
Greater than or equal comparison.
Less than comparison.
Less than or equal comparison
Check for equality and regard missing values as equal.
Check for equality.
Check for inequality.
Greater than comparison.
Greater than or equal comparison.
Less than comparison.
Less than or equal comparison
Check for equality and regard missing values as equal.
Check for equality.
Check for inequality.
Greater than comparison.
Greater than or equal comparison.
Less than comparison.
Less than or equal comparison
Check for equality and regard missing values as equal.
Check for equality.
Check for inequality.
Greater than comparison.
Greater than or equal comparison.
Less than comparison.
Less than or equal comparison
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,
Check for equality and regard missing values as equal.
Check for equality.
Check for inequality.
Greater than comparison.
Greater than or equal comparison.
Less than comparison.
Less than or equal comparison
impl<T> ChunkCumAgg<T> for ChunkedArray<T> where
T: PolarsNumericType,
ChunkedArray<T>: FromIterator<Option<T::Native>>,
impl<T> ChunkCumAgg<T> for ChunkedArray<T> where
T: PolarsNumericType,
ChunkedArray<T>: FromIterator<Option<T::Native>>,
cum_agg
only.Get an array with the cumulative max computed at every element
cum_agg
only.Get an array with the cumulative min computed at every element
cum_agg
only.Get an array with the cumulative sum computed at every element
cum_agg
only.Get an array with the cumulative product computed at every element
impl<T> ChunkExpandAtIndex<T> for ChunkedArray<T> where
ChunkedArray<T>: ChunkFull<T::Native> + TakeRandom<Item = T::Native>,
T: PolarsNumericType,
impl<T> ChunkExpandAtIndex<T> for ChunkedArray<T> where
ChunkedArray<T>: ChunkFull<T::Native> + TakeRandom<Item = T::Native>,
T: PolarsNumericType,
Create a new ChunkedArray filled with values at that index.
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>,
Replace None values with one of the following strategies: Read more
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,
Replace None values with a give value T
.
Filter values in the ChunkedArray with a boolean mask. Read more
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,
Get a boolean mask of the local maximum peaks.
Get a boolean mask of the local minimum peaks.
impl<T> ChunkReverse<T> for ChunkedArray<T> where
T: PolarsNumericType,
ChunkedArray<T>: ChunkOps,
impl<T> ChunkReverse<T> for ChunkedArray<T> where
T: PolarsNumericType,
ChunkedArray<T>: ChunkOps,
Return a reversed version of this array.
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,
fn set_at_idx<I: IntoIterator<Item = usize>>(
&'a self,
idx: I,
value: Option<T::Native>
) -> Result<Self>
fn set_at_idx<I: IntoIterator<Item = usize>>(
&'a self,
idx: I,
value: Option<T::Native>
) -> Result<Self>
Set the values at indexes idx
to some optional value Option<T>
. Read more
fn set_at_idx_with<I: IntoIterator<Item = usize>, F>(
&'a self,
idx: I,
f: F
) -> Result<Self> where
F: Fn(Option<T::Native>) -> Option<T::Native>,
fn set_at_idx_with<I: IntoIterator<Item = usize>, F>(
&'a self,
idx: I,
f: F
) -> Result<Self> where
F: Fn(Option<T::Native>) -> Option<T::Native>,
Set the values at indexes idx
by applying a closure to these values. Read more
Set the values where the mask evaluates to true
to some optional value Option<T>
. Read more
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,
Shift the values by a given period and fill the parts that will be empty due to this operation
with fill_value
. Read more
Panics
This function is very opinionated.
We assume that all numeric Series
are of the same type, if not it will panic
Returned a sorted ChunkedArray
.
Sort this array in place.
Retrieve the indexes needed to sort this array.
unsafe fn take_unchecked<I, INulls>(
&self,
indices: TakeIdx<'_, I, INulls>
) -> Self where
Self: Sized,
I: TakeIterator,
INulls: TakeIteratorNulls,
unsafe fn take_unchecked<I, INulls>(
&self,
indices: TakeIdx<'_, I, INulls>
) -> Self where
Self: Sized,
I: TakeIterator,
INulls: TakeIteratorNulls,
Take values from ChunkedArray by index. Read more
fn take<I, INulls>(&self, indices: TakeIdx<'_, I, INulls>) -> Result<Self> where
Self: Sized,
I: TakeIterator,
INulls: TakeIteratorNulls,
fn take<I, INulls>(&self, indices: TakeIdx<'_, I, INulls>) -> Result<Self> where
Self: Sized,
I: TakeIterator,
INulls: TakeIteratorNulls,
Take values from ChunkedArray by index. Note that the iterator will be cloned, so prefer an iterator that takes the owned memory by reference. Read more
Traverse and collect every nth element in a new array.
impl<T> ChunkUnique<T> for ChunkedArray<T> where
T: PolarsIntegerType,
T::Native: Hash + Eq,
ChunkedArray<T>: ChunkOps + IntoSeries,
impl<T> ChunkUnique<T> for ChunkedArray<T> where
T: PolarsIntegerType,
T::Native: Hash + Eq,
ChunkedArray<T>: ChunkOps + IntoSeries,
Get first index of the unique values in a ChunkedArray
.
This Vec is sorted. Read more
Get a mask of all the unique values.
Get a mask of all the duplicated values.
Count the unique values.
Create a new ChunkedArray with values from self where the mask evaluates true
and values
from other
where the mask evaluates false
Read more
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
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
Performs the conversion.
From trait
Performs the conversion.
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>
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
impl<T: PolarsNumericType> From<PrimitiveArray<<T as PolarsNumericType>::Native>> for ChunkedArray<T>
impl<T: PolarsNumericType> From<PrimitiveArray<<T as PolarsNumericType>::Native>> for ChunkedArray<T>
Performs the conversion.
impl<T> FromIterator<(MutableBuffer<<T as PolarsNumericType>::Native>, Option<Bitmap>)> for ChunkedArray<T> where
T: PolarsNumericType,
impl<T> FromIterator<(MutableBuffer<<T as PolarsNumericType>::Native>, Option<Bitmap>)> for ChunkedArray<T> where
T: PolarsNumericType,
fn from_iter<I: IntoIterator<Item = (AlignedVec<T::Native>, Option<Bitmap>)>>(
iter: I
) -> Self
fn from_iter<I: IntoIterator<Item = (AlignedVec<T::Native>, Option<Bitmap>)>>(
iter: I
) -> Self
Creates a value from an iterator. Read more
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
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,
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,
Creates an instance of the collection from the parallel iterator par_iter
. Read more
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<bool>>>(
iter: I
) -> Self where
I::IntoIter: TrustedLen,
interpolate
only.Create the tuples need for a groupby operation. * The first value in the tuple is the first index of the group. * The second value in the tuple is are the indexes of the groups including the first value. Read more
type TakeRandom = TakeRandBranch3<NumTakeRandomCont<'a, T::Native>, NumTakeRandomSingleChunk<'a, T::Native>, NumTakeRandomChunked<'a, T::Native>>
Create a type that implements TakeRandom
.
is_first
only.is_in
only.Check if elements of this array are in the right Series, or List values of the right Series.
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,
Create a new ChunkedArray from an iterator.
fn new_from_opt_iter(
name: &str,
it: impl Iterator<Item = Option<T::Native>>
) -> ChunkedArray<T>
fn new_from_opt_iter(
name: &str,
it: impl Iterator<Item = Option<T::Native>>
) -> ChunkedArray<T>
Create a new ChunkedArray from an iterator.
impl<T> NumOpsDispatch for ChunkedArray<T> where
T: PolarsNumericType,
ChunkedArray<T>: IntoSeries,
impl<T> NumOpsDispatch for ChunkedArray<T> where
T: PolarsNumericType,
ChunkedArray<T>: IntoSeries,
impl<T> NumOpsDispatchChecked for ChunkedArray<T> where
T: PolarsIntegerType,
T::Native: CheckedDiv<Output = T::Native> + Zero + One,
ChunkedArray<T>: IntoSeries,
impl<T> NumOpsDispatchChecked for ChunkedArray<T> where
T: PolarsIntegerType,
T::Native: CheckedDiv<Output = T::Native> + Zero + One,
ChunkedArray<T>: IntoSeries,
Checked integer division. Computes self / rhs, returning None if rhs == 0 or the division results in overflow.
repeat_by
only.Repeat the values n
times, where n
is determined by the values in by
.
impl<T> ToDummies<T> for ChunkedArray<T> where
T: PolarsIntegerType + Sync,
T::Native: Hash + Eq,
ChunkedArray<T>: ChunkOps + ChunkCompare<T::Native> + ChunkUnique<T>,
impl<T> ToDummies<T> for ChunkedArray<T> where
T: PolarsIntegerType + Sync,
T::Native: Hash + Eq,
ChunkedArray<T>: ChunkOps + ChunkCompare<T::Native> + ChunkUnique<T>,
impl<T> VarAggSeries for ChunkedArray<T> where
T: PolarsIntegerType,
<T::Native as Simd>::Simd: Add<Output = <T::Native as Simd>::Simd> + Sum<T::Native> + SimdOrd<T::Native>,
impl<T> VarAggSeries for ChunkedArray<T> where
T: PolarsIntegerType,
<T::Native as Simd>::Simd: Add<Output = <T::Native as Simd>::Simd> + Sum<T::Native> + SimdOrd<T::Native>,
Get the variance of the ChunkedArray as a new Series of length 1.
Get the standard deviation of the ChunkedArray as a new Series of length 1.
Compute the hash for all values in the array. Read more
impl<T> ZipOuterJoinColumn for ChunkedArray<T> where
T: PolarsIntegerType,
ChunkedArray<T>: IntoSeries,
impl<T> ZipOuterJoinColumn for ChunkedArray<T> where
T: PolarsIntegerType,
ChunkedArray<T>: IntoSeries,
Auto Trait Implementations
impl<T> !RefUnwindSafe for ChunkedArray<T>
impl<T> Send for ChunkedArray<T> where
T: Send,
impl<T> Sync for ChunkedArray<T> where
T: Sync,
impl<T> Unpin for ChunkedArray<T> where
T: Unpin,
impl<T> !UnwindSafe for ChunkedArray<T>
Blanket Implementations
Mutably borrows from an owned value. Read more