polars_core::chunked_array::ops

Trait ChunkAgg

Source
pub trait ChunkAgg<T> {
    // Required method
    fn _sum_as_f64(&self) -> f64;

    // Provided methods
    fn sum(&self) -> Option<T> { ... }
    fn min(&self) -> Option<T> { ... }
    fn max(&self) -> Option<T> { ... }
    fn min_max(&self) -> Option<(T, T)> { ... }
    fn mean(&self) -> Option<f64> { ... }
}
Expand description

Aggregation operations.

Required Methods§

Source

fn _sum_as_f64(&self) -> f64

Provided Methods§

Source

fn sum(&self) -> Option<T>

Aggregate the sum of the ChunkedArray. Returns None if not implemented for T. If the array is empty, 0 is returned

Source

fn min(&self) -> Option<T>

Source

fn max(&self) -> Option<T>

Returns the maximum value in the array, according to the natural order. Returns None if the array is empty or only contains null values.

Source

fn min_max(&self) -> Option<(T, T)>

Source

fn mean(&self) -> Option<f64>

Returns the mean value in the array. Returns None if the array is empty or only contains null values.

Implementors§

Source§

impl<T> ChunkAgg<<T as PolarsNumericType>::Native> 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>,