pub trait ChunkAggSeries {
    fn sum_as_series(&self) -> Series { ... }
    fn max_as_series(&self) -> Series { ... }
    fn min_as_series(&self) -> Series { ... }
    fn prod_as_series(&self) -> Series { ... }
}
Expand description

Aggregations that return Series of unit length. Those can be used in broadcasting operations.

Provided Methods§

Get the sum of the ChunkedArray as a new Series of length 1.

Examples found in repository?
src/series/implementations/boolean.rs (line 330)
329
330
331
    fn _sum_as_series(&self) -> Series {
        ChunkAggSeries::sum_as_series(&self.0)
    }
More examples
Hide additional examples
src/series/implementations/list.rs (line 204)
203
204
205
    fn _sum_as_series(&self) -> Series {
        ChunkAggSeries::sum_as_series(&self.0)
    }
src/series/implementations/utf8.rs (line 316)
315
316
317
    fn _sum_as_series(&self) -> Series {
        ChunkAggSeries::sum_as_series(&self.0)
    }

Get the max of the ChunkedArray as a new Series of length 1.

Examples found in repository?
src/series/implementations/boolean.rs (line 333)
332
333
334
    fn max_as_series(&self) -> Series {
        ChunkAggSeries::max_as_series(&self.0)
    }
More examples
Hide additional examples
src/series/implementations/list.rs (line 207)
206
207
208
    fn max_as_series(&self) -> Series {
        ChunkAggSeries::max_as_series(&self.0)
    }
src/series/implementations/utf8.rs (line 319)
318
319
320
    fn max_as_series(&self) -> Series {
        ChunkAggSeries::max_as_series(&self.0)
    }

Get the min of the ChunkedArray as a new Series of length 1.

Examples found in repository?
src/series/implementations/boolean.rs (line 336)
335
336
337
    fn min_as_series(&self) -> Series {
        ChunkAggSeries::min_as_series(&self.0)
    }
More examples
Hide additional examples
src/series/implementations/list.rs (line 210)
209
210
211
    fn min_as_series(&self) -> Series {
        ChunkAggSeries::min_as_series(&self.0)
    }
src/series/implementations/utf8.rs (line 322)
321
322
323
    fn min_as_series(&self) -> Series {
        ChunkAggSeries::min_as_series(&self.0)
    }

Get the product of the ChunkedArray as a new Series of length 1.

Examples found in repository?
src/series/mod.rs (line 666)
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
    pub fn product(&self) -> Series {
        #[cfg(feature = "product")]
        {
            use DataType::*;
            match self.dtype() {
                Boolean => self.cast(&DataType::Int64).unwrap().product(),
                Int8 | UInt8 | Int16 | UInt16 => {
                    let s = self.cast(&Int64).unwrap();
                    s.product()
                }
                Int64 => {
                    let ca = self.i64().unwrap();
                    ca.prod_as_series()
                }
                Float32 => {
                    let ca = self.f32().unwrap();
                    ca.prod_as_series()
                }
                Float64 => {
                    let ca = self.f64().unwrap();
                    ca.prod_as_series()
                }
                dt => panic!("cumprod not supported for dtype: {dt:?}"),
            }
        }
        #[cfg(not(feature = "product"))]
        {
            panic!("activate 'product' feature")
        }
    }

Implementors§