Struct polars::prelude::LazyGroupBy[][src]

pub struct LazyGroupBy { /* fields omitted */ }

Utility struct for lazy groupby operation.

Implementations

impl LazyGroupBy[src]

pub fn agg(self, aggs: Vec<Expr, Global>) -> LazyFrame[src]

Group by and aggregate.

Select a column with col and choose an aggregation. If you want to aggregate all columns use col("*").

Example

use polars_core::prelude::*;
use polars_lazy::prelude::*;

fn example(df: DataFrame) -> LazyFrame {
      df.lazy()
       .groupby(vec![col("date")])
       .agg(vec![
           col("rain").min(),
           col("rain").sum(),
           col("rain").quantile(0.5).alias("median_rain"),
       ])
       .sort("date", false)
}

pub fn apply<F>(self, f: F) -> LazyFrame where
    F: 'static + Fn(DataFrame) -> Result<DataFrame, PolarsError> + Send + Sync
[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T, U> Cast<U> for T where
    U: FromCast<T>, 

impl<T> From<T> for T[src]

impl<T> FromCast<T> for T

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Pointable for T

type Init = T

The type for initializers.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,