Enum polars::prelude::Expr

pub enum Expr {
Show 26 variants Alias(Box<Expr>, Arc<str>), Column(Arc<str>), Columns(Vec<String>), DtypeColumn(Vec<DataType>), Literal(LiteralValue), BinaryExpr { left: Box<Expr>, op: Operator, right: Box<Expr>, }, Cast { expr: Box<Expr>, data_type: DataType, strict: bool, }, Sort { expr: Box<Expr>, options: SortOptions, }, Gather { expr: Box<Expr>, idx: Box<Expr>, returns_scalar: bool, }, SortBy { expr: Box<Expr>, by: Vec<Expr>, descending: Vec<bool>, }, Agg(AggExpr), Ternary { predicate: Box<Expr>, truthy: Box<Expr>, falsy: Box<Expr>, }, Function { input: Vec<Expr>, function: FunctionExpr, options: FunctionOptions, }, Explode(Box<Expr>), Filter { input: Box<Expr>, by: Box<Expr>, }, Window { function: Box<Expr>, partition_by: Vec<Expr>, options: WindowType, }, Wildcard, Slice { input: Box<Expr>, offset: Box<Expr>, length: Box<Expr>, }, Exclude(Box<Expr>, Vec<Excluded>), KeepName(Box<Expr>), Count, Nth(i64), RenameAlias { function: SpecialEq<Arc<dyn RenameAliasFn>>, expr: Box<Expr>, }, AnonymousFunction { input: Vec<Expr>, function: SpecialEq<Arc<dyn SeriesUdf>>, output_type: SpecialEq<Arc<dyn FunctionOutputField>>, options: FunctionOptions, }, SubPlan(SpecialEq<Arc<LogicalPlan>>, Vec<String>), Selector(Selector),
}
Available on crate feature lazy only.
Expand description

Expressions that can be used in various contexts. Queries consist of multiple expressions. When using the polars lazy API, don’t construct an Expr directly; instead, create one using the functions in the polars_lazy::dsl module. See that module’s docs for more info.

Variants§

§

Alias(Box<Expr>, Arc<str>)

§

Column(Arc<str>)

§

Columns(Vec<String>)

§

DtypeColumn(Vec<DataType>)

§

Literal(LiteralValue)

§

BinaryExpr

Fields

§left: Box<Expr>
§right: Box<Expr>
§

Cast

Fields

§expr: Box<Expr>
§data_type: DataType
§strict: bool
§

Sort

Fields

§expr: Box<Expr>
§options: SortOptions
§

Gather

Fields

§expr: Box<Expr>
§idx: Box<Expr>
§returns_scalar: bool
§

SortBy

Fields

§expr: Box<Expr>
§by: Vec<Expr>
§descending: Vec<bool>
§

Agg(AggExpr)

§

Ternary

Fields

§predicate: Box<Expr>
§truthy: Box<Expr>
§falsy: Box<Expr>

A ternary operation if true then “foo” else “bar”

§

Function

Fields

§input: Vec<Expr>

function arguments

§function: FunctionExpr

function to apply

§options: FunctionOptions
§

Explode(Box<Expr>)

§

Filter

Fields

§input: Box<Expr>
§by: Box<Expr>
§

Window

Fields

§function: Box<Expr>

Also has the input. i.e. avg(“foo”)

§partition_by: Vec<Expr>
§options: WindowType

See postgres window functions

§

Wildcard

§

Slice

Fields

§input: Box<Expr>
§offset: Box<Expr>

length is not yet known so we accept negative offsets

§length: Box<Expr>
§

Exclude(Box<Expr>, Vec<Excluded>)

Can be used in a select statement to exclude a column from selection

§

KeepName(Box<Expr>)

Set root name as Alias

§

Count

Special case that does not need columns

§

Nth(i64)

Take the nth column in the DataFrame

§

RenameAlias

Fields

§function: SpecialEq<Arc<dyn RenameAliasFn>>
§expr: Box<Expr>
§

AnonymousFunction

Fields

§input: Vec<Expr>

function arguments

§function: SpecialEq<Arc<dyn SeriesUdf>>

function to apply

§output_type: SpecialEq<Arc<dyn FunctionOutputField>>

output dtype of the function

§options: FunctionOptions
§

SubPlan(SpecialEq<Arc<LogicalPlan>>, Vec<String>)

§

Selector(Selector)

Expressions in this node should only be expanding e.g. Expr::Columns Expr::Dtypes Expr::Wildcard Expr::Exclude

Implementations§

§

impl Expr

pub fn to_dot(&self) -> Result<String, PolarsError>

Get a dot language representation of the Expression.

§

impl Expr

pub fn floor_div(self, rhs: Expr) -> Expr

Floor divide self by rhs.

pub fn pow<E>(self, exponent: E) -> Exprwhere E: Into<Expr>,

Raise expression to the power exponent

pub fn sqrt(self) -> Expr

Compute the square root of the given expression

pub fn cbrt(self) -> Expr

Compute the cube root of the given expression

§

impl Expr

pub fn to_field( &self, schema: &Schema, ctxt: Context ) -> Result<Field, PolarsError>

Get Field result of the expression. The schema is the input data.

§

impl Expr

pub fn shuffle(self, seed: Option<u64>) -> Expr

pub fn sample_n( self, n: Expr, with_replacement: bool, shuffle: bool, seed: Option<u64> ) -> Expr

pub fn sample_frac( self, frac: Expr, with_replacement: bool, shuffle: bool, seed: Option<u64> ) -> Expr

§

impl Expr

pub fn eq<E>(self, other: E) -> Exprwhere E: Into<Expr>,

Compare Expr with other Expr on equality.

pub fn eq_missing<E>(self, other: E) -> Exprwhere E: Into<Expr>,

Compare Expr with other Expr on equality where None == None.

pub fn neq<E>(self, other: E) -> Exprwhere E: Into<Expr>,

Compare Expr with other Expr on non-equality.

pub fn neq_missing<E>(self, other: E) -> Exprwhere E: Into<Expr>,

Compare Expr with other Expr on non-equality where None == None.

pub fn lt<E>(self, other: E) -> Exprwhere E: Into<Expr>,

Check if Expr < Expr.

pub fn gt<E>(self, other: E) -> Exprwhere E: Into<Expr>,

Check if Expr > Expr.

pub fn gt_eq<E>(self, other: E) -> Exprwhere E: Into<Expr>,

Check if Expr >= Expr.

pub fn lt_eq<E>(self, other: E) -> Exprwhere E: Into<Expr>,

Check if Expr <= Expr.

pub fn not(self) -> Expr

Negate Expr.

pub fn alias(self, name: &str) -> Expr

Rename Column.

pub fn is_null(self) -> Expr

Run is_null operation on Expr.

pub fn is_not_null(self) -> Expr

Run is_not_null operation on Expr.

pub fn drop_nulls(self) -> Expr

Drop null values.

pub fn drop_nans(self) -> Expr

Drop NaN values.

pub fn min(self) -> Expr

Reduce groups to minimal value.

pub fn max(self) -> Expr

Reduce groups to maximum value.

pub fn nan_min(self) -> Expr

Reduce groups to minimal value.

pub fn nan_max(self) -> Expr

Reduce groups to maximum value.

pub fn mean(self) -> Expr

Reduce groups to the mean value.

pub fn median(self) -> Expr

Reduce groups to the median value.

pub fn sum(self) -> Expr

Reduce groups to the sum of all the values.

pub fn n_unique(self) -> Expr

Get the number of unique values in the groups.

pub fn first(self) -> Expr

Get the first value in the group.

pub fn last(self) -> Expr

Get the last value in the group.

pub fn implode(self) -> Expr

Aggregate the group to a Series.

pub fn quantile(self, quantile: Expr, interpol: QuantileInterpolOptions) -> Expr

Compute the quantile per group.

pub fn agg_groups(self) -> Expr

Get the group indexes of the group by operation.

pub fn flatten(self) -> Expr

Alias for explode.

pub fn explode(self) -> Expr

Explode the utf8/ list column.

pub fn slice<E, F>(self, offset: E, length: F) -> Exprwhere E: Into<Expr>, F: Into<Expr>,

Slice the Series. offset may be negative.

pub fn append<E>(self, other: E, upcast: bool) -> Exprwhere E: Into<Expr>,

Append expressions. This is done by adding the chunks of other to this Series.

pub fn head(self, length: Option<usize>) -> Expr

Get the first n elements of the Expr result.

pub fn tail(self, length: Option<usize>) -> Expr

Get the last n elements of the Expr result.

pub fn unique(self) -> Expr

Get unique values of this expression.

pub fn unique_stable(self) -> Expr

Get unique values of this expression, while maintaining order. This requires more work than Expr::unique.

pub fn arg_unique(self) -> Expr

Get the first index of unique values of this expression.

pub fn arg_min(self) -> Expr

Get the index value that has the minimum value.

pub fn arg_max(self) -> Expr

Get the index value that has the maximum value.

pub fn arg_sort(self, sort_options: SortOptions) -> Expr

Get the index values that would sort this expression.

pub fn strict_cast(self, data_type: DataType) -> Expr

Cast expression to another data type. Throws an error if conversion had overflows.

pub fn cast(self, data_type: DataType) -> Expr

Cast expression to another data type.

pub fn gather<E>(self, idx: E) -> Exprwhere E: Into<Expr>,

Take the values by idx.

pub fn get<E>(self, idx: E) -> Exprwhere E: Into<Expr>,

Take the values by a single index.

pub fn sort(self, descending: bool) -> Expr

Sort in increasing order. See the eager implementation.

pub fn sort_with(self, options: SortOptions) -> Expr

Sort with given options.

pub fn reverse(self) -> Expr

Reverse column

pub fn map<F>( self, function: F, output_type: SpecialEq<Arc<dyn FunctionOutputField>> ) -> Exprwhere F: Fn(Series) -> Result<Option<Series>, PolarsError> + 'static + Send + Sync,

Apply a function/closure once the logical plan get executed.

This function is very similar to Expr::apply, but differs in how it handles aggregations.

  • map should be used for operations that are independent of groups, e.g. multiply * 2, or raise to the power
  • apply should be used for operations that work on a group of data. e.g. sum, count, etc.

It is the responsibility of the caller that the schema is correct by giving the correct output_type. If None given the output type of the input expr is used.

pub fn map_many<F>( self, function: F, arguments: &[Expr], output_type: SpecialEq<Arc<dyn FunctionOutputField>> ) -> Exprwhere F: Fn(&mut [Series]) -> Result<Option<Series>, PolarsError> + 'static + Send + Sync,

Apply a function/closure once the logical plan get executed with many arguments.

See the Expr::map function for the differences between map and apply.

pub fn map_list<F>( self, function: F, output_type: SpecialEq<Arc<dyn FunctionOutputField>> ) -> Exprwhere F: Fn(Series) -> Result<Option<Series>, PolarsError> + 'static + Send + Sync,

Apply a function/closure once the logical plan get executed.

This function is very similar to apply, but differs in how it handles aggregations.

  • map should be used for operations that are independent of groups, e.g. multiply * 2, or raise to the power
  • apply should be used for operations that work on a group of data. e.g. sum, count, etc.
  • map_list should be used when the function expects a list aggregated series.

pub fn function_with_options<F>( self, function: F, output_type: SpecialEq<Arc<dyn FunctionOutputField>>, options: FunctionOptions ) -> Exprwhere F: Fn(Series) -> Result<Option<Series>, PolarsError> + 'static + Send + Sync,

A function that cannot be expressed with map or apply and requires extra settings.

pub fn apply<F>( self, function: F, output_type: SpecialEq<Arc<dyn FunctionOutputField>> ) -> Exprwhere F: Fn(Series) -> Result<Option<Series>, PolarsError> + 'static + Send + Sync,

Apply a function/closure over the groups. This should only be used in a group_by aggregation.

It is the responsibility of the caller that the schema is correct by giving the correct output_type. If None given the output type of the input expr is used.

This difference with map is that apply will create a separate Series per group.

  • map should be used for operations that are independent of groups, e.g. multiply * 2, or raise to the power
  • apply should be used for operations that work on a group of data. e.g. sum, count, etc.

pub fn apply_many<F>( self, function: F, arguments: &[Expr], output_type: SpecialEq<Arc<dyn FunctionOutputField>> ) -> Exprwhere F: Fn(&mut [Series]) -> Result<Option<Series>, PolarsError> + 'static + Send + Sync,

Apply a function/closure over the groups with many arguments. This should only be used in a group_by aggregation.

See the Expr::apply function for the differences between map and apply.

pub fn apply_many_private( self, function_expr: FunctionExpr, arguments: &[Expr], auto_explode: bool, cast_to_supertypes: bool ) -> Expr

pub fn map_many_private( self, function_expr: FunctionExpr, arguments: &[Expr], returns_scalar: bool, cast_to_supertypes: bool ) -> Expr

pub fn is_finite(self) -> Expr

Get mask of finite values if dtype is Float.

pub fn is_infinite(self) -> Expr

Get mask of infinite values if dtype is Float.

pub fn is_nan(self) -> Expr

Get mask of NaN values if dtype is Float.

pub fn is_not_nan(self) -> Expr

Get inverse mask of NaN values if dtype is Float.

pub fn shift(self, n: Expr) -> Expr

Shift the values in the array by some period. See the eager implementation.

pub fn shift_and_fill<E>(self, n: E, fill_value: E) -> Exprwhere E: Into<Expr>,

Shift the values in the array by some period and fill the resulting empty values.

pub fn cum_count(self, reverse: bool) -> Expr

Available on crate feature cum_agg only.

Cumulatively count values from 0 to len.

pub fn cum_sum(self, reverse: bool) -> Expr

Available on crate feature cum_agg only.

Get an array with the cumulative sum computed at every element.

pub fn cum_prod(self, reverse: bool) -> Expr

Available on crate feature cum_agg only.

Get an array with the cumulative product computed at every element.

pub fn cum_min(self, reverse: bool) -> Expr

Available on crate feature cum_agg only.

Get an array with the cumulative min computed at every element.

pub fn cum_max(self, reverse: bool) -> Expr

Available on crate feature cum_agg only.

Get an array with the cumulative max computed at every element.

pub fn product(self) -> Expr

Get the product aggregation of an expression.

pub fn backward_fill(self, limit: Option<u32>) -> Expr

Fill missing value with next non-null.

pub fn forward_fill(self, limit: Option<u32>) -> Expr

Fill missing value with previous non-null.

pub fn round(self, decimals: u32) -> Expr

Available on crate feature round_series only.

Round underlying floating point array to given decimal numbers.

pub fn round_sig_figs(self, digits: i32) -> Expr

Available on crate feature round_series only.

Round to a number of significant figures.

pub fn floor(self) -> Expr

Available on crate feature round_series only.

Floor underlying floating point array to the lowest integers smaller or equal to the float value.

pub fn pi() -> Expr

Available on crate feature round_series only.

Constant Pi

pub fn ceil(self) -> Expr

Available on crate feature round_series only.

Ceil underlying floating point array to the highest integers smaller or equal to the float value.

pub fn clip(self, min: Expr, max: Expr) -> Expr

Available on crate feature round_series only.

Clip underlying values to a set boundary.

pub fn clip_max(self, max: Expr) -> Expr

Available on crate feature round_series only.

Clip underlying values to a set boundary.

pub fn clip_min(self, min: Expr) -> Expr

Available on crate feature round_series only.

Clip underlying values to a set boundary.

pub fn abs(self) -> Expr

Available on crate feature abs only.

Convert all values to their absolute/positive value.

pub fn over<E, IE>(self, partition_by: E) -> Exprwhere E: AsRef<[IE]>, IE: Into<Expr> + Clone,

Apply window function over a subgroup. This is similar to a group_by + aggregation + self join. Or similar to window functions in Postgres.

Example
#[macro_use] extern crate polars_core;
use polars_core::prelude::*;
use polars_lazy::prelude::*;

fn example() -> PolarsResult<()> {
    let df = df! {
            "groups" => &[1, 1, 2, 2, 1, 2, 3, 3, 1],
            "values" => &[1, 2, 3, 4, 5, 6, 7, 8, 8]
        }?;

    let out = df
     .lazy()
     .select(&[
         col("groups"),
         sum("values").over([col("groups")]),
     ])
     .collect()?;
    println!("{}", &out);
    Ok(())
}

Outputs:

╭────────┬────────╮
│ groups ┆ values │
│ ---    ┆ ---    │
│ i32    ┆ i32    │
╞════════╪════════╡
│ 1      ┆ 16     │
│ 1      ┆ 16     │
│ 2      ┆ 13     │
│ 2      ┆ 13     │
│ …      ┆ …      │
│ 1      ┆ 16     │
│ 2      ┆ 13     │
│ 3      ┆ 15     │
│ 3      ┆ 15     │
│ 1      ┆ 16     │
╰────────┴────────╯

pub fn over_with_options<E, IE>( self, partition_by: E, options: WindowMapping ) -> Exprwhere E: AsRef<[IE]>, IE: Into<Expr> + Clone,

pub fn rolling(self, options: RollingGroupOptions) -> Expr

Available on crate feature dynamic_group_by only.

pub fn fill_null<E>(self, fill_value: E) -> Exprwhere E: Into<Expr>,

Replace the null values by a value.

pub fn fill_nan<E>(self, fill_value: E) -> Exprwhere E: Into<Expr>,

Replace the floating point NaN values by a value.

pub fn count(self) -> Expr

Count the values of the Series or Get counts of the group by operation.

pub fn std(self, ddof: u8) -> Expr

Standard deviation of the values of the Series.

pub fn var(self, ddof: u8) -> Expr

Variance of the values of the Series.

pub fn and<E>(self, expr: E) -> Exprwhere E: Into<Expr>,

“and” operation.

pub fn xor<E>(self, expr: E) -> Exprwhere E: Into<Expr>,

“xor” operation.

pub fn or<E>(self, expr: E) -> Exprwhere E: Into<Expr>,

“or” operation.

pub fn filter<E>(self, predicate: E) -> Exprwhere E: Into<Expr>,

Filter a single column.

Should be used in aggregation context. If you want to filter on a DataFrame level, use LazyFrame::filter.

pub fn is_in<E>(self, other: E) -> Exprwhere E: Into<Expr>,

Available on crate feature is_in only.

Check if the values of the left expression are in the lists of the right expr.

pub fn sort_by<E, IE, R>(self, by: E, descending: R) -> Exprwhere E: AsRef<[IE]>, IE: Into<Expr> + Clone, R: AsRef<[bool]>,

Sort this column by the ordering of another column. Can also be used in a group_by context to sort the groups.

pub fn repeat_by<E>(self, by: E) -> Exprwhere E: Into<Expr>,

Available on crate feature repeat_by only.

Repeat the column n times, where n is determined by the values in by. This yields an Expr of dtype List.

pub fn is_first_distinct(self) -> Expr

Available on crate feature is_first_distinct only.

Get a mask of the first unique value.

pub fn is_last_distinct(self) -> Expr

Available on crate feature is_last_distinct only.

Get a mask of the last unique value.

pub fn dot<E>(self, other: E) -> Exprwhere E: Into<Expr>,

Compute the dot/inner product between two expressions.

pub fn mode(self) -> Expr

Available on crate feature mode only.

Compute the mode(s) of this column. This is the most occurring value.

pub fn exclude(self, columns: impl IntoVec<String>) -> Expr

Exclude a column from a wildcard/regex selection.

You may also use regexes in the exclude as long as they start with ^ and end with $/

pub fn exclude_dtype<D>(self, dtypes: D) -> Exprwhere D: AsRef<[DataType]>,

pub fn interpolate(self, method: InterpolationMethod) -> Expr

Available on crate feature interpolate only.

Fill null values using interpolation.

pub fn rolling_min(self, options: RollingOptions) -> Expr

Available on crate feature rolling_window only.

Apply a rolling minimum.

See: [RollingAgg::rolling_min]

pub fn rolling_max(self, options: RollingOptions) -> Expr

Available on crate feature rolling_window only.

Apply a rolling maximum.

See: [RollingAgg::rolling_max]

pub fn rolling_mean(self, options: RollingOptions) -> Expr

Available on crate feature rolling_window only.

Apply a rolling mean.

See: [RollingAgg::rolling_mean]

pub fn rolling_sum(self, options: RollingOptions) -> Expr

Available on crate feature rolling_window only.

Apply a rolling sum.

See: [RollingAgg::rolling_sum]

pub fn rolling_median(self, options: RollingOptions) -> Expr

Available on crate feature rolling_window only.

Apply a rolling median.

See: [RollingAgg::rolling_median]

pub fn rolling_quantile(self, options: RollingOptions) -> Expr

Available on crate feature rolling_window only.

Apply a rolling quantile.

See: [RollingAgg::rolling_quantile]

pub fn rolling_var(self, options: RollingOptions) -> Expr

Available on crate feature rolling_window only.

Apply a rolling variance.

pub fn rolling_std(self, options: RollingOptions) -> Expr

Available on crate feature rolling_window only.

Apply a rolling std-dev.

pub fn rolling_map( self, f: Arc<dyn Fn(&Series) -> Series + Send + Sync>, output_type: SpecialEq<Arc<dyn FunctionOutputField>>, options: RollingOptionsFixedWindow ) -> Expr

Available on crate feature rolling_window only.

Apply a custom function over a rolling/ moving window of the array. This has quite some dynamic dispatch, so prefer rolling_min, max, mean, sum over this.

pub fn rolling_map_float<F>(self, window_size: usize, f: F) -> Exprwhere F: 'static + FnMut(&mut ChunkedArray<Float64Type>) -> Option<f64> + Send + Sync + Copy,

Available on crate feature rolling_window only.

Apply a custom function over a rolling/ moving window of the array. Prefer this over rolling_apply in case of floating point numbers as this is faster. This has quite some dynamic dispatch, so prefer rolling_min, max, mean, sum over this.

pub fn rank(self, options: RankOptions, seed: Option<u64>) -> Expr

Available on crate feature rank only.

Assign ranks to data, dealing with ties appropriately.

pub fn diff(self, n: i64, null_behavior: NullBehavior) -> Expr

Available on crate feature diff only.

Calculate the n-th discrete difference between values.

pub fn upper_bound(self) -> Expr

Get maximal value that could be hold by this dtype.

pub fn lower_bound(self) -> Expr

Get minimal value that could be hold by this dtype.

pub fn reshape(self, dims: &[i64]) -> Expr

pub fn any(self, ignore_nulls: bool) -> Expr

Returns whether any of the values in the column are true.

If ignore_nulls is False, Kleene logic is used to deal with nulls: if the column contains any null values and no true values, the output is null.

pub fn all(self, ignore_nulls: bool) -> Expr

Returns whether all values in the column are true.

If ignore_nulls is False, Kleene logic is used to deal with nulls: if the column contains any null values and no true values, the output is null.

pub fn shrink_dtype(self) -> Expr

Shrink numeric columns to the minimal required datatype needed to fit the extrema of this Series. This can be used to reduce memory pressure.

pub fn value_counts(self, sort: bool, parallel: bool) -> Expr

Available on crate feature dtype-struct only.

Count all unique values and create a struct mapping value to count. (Note that it is better to turn parallel off in the aggregation context).

pub fn null_count(self) -> Expr

Get the null count of the column/group.

pub fn set_sorted_flag(self, sorted: IsSorted) -> Expr

Set this Series as sorted so that downstream code can use fast paths for sorted arrays.

Warning

This can lead to incorrect results if this Series is not sorted!! Use with care!

pub fn to_physical(self) -> Expr

pub fn str(self) -> StringNameSpace

Available on crate feature strings only.

pub fn binary(self) -> BinaryNameSpace

pub fn dt(self) -> DateLikeNameSpace

Available on crate feature temporal only.

pub fn list(self) -> ListNameSpace

pub fn name(self) -> ExprNameNameSpace

Get the [name::ExprNameNameSpace]

pub fn arr(self) -> ArrayNameSpace

Available on crate feature dtype-array only.

pub fn cat(self) -> CategoricalNameSpace

Available on crate feature dtype-categorical only.

pub fn struct_(self) -> StructNameSpace

Available on crate feature dtype-struct only.
§

impl Expr

pub fn mutate(&mut self) -> ExprMut<'_>

Expr::mutate().apply(fn())

§

impl Expr

pub fn nodes<'a>(&'a self, container: &mut Vec<&'a Expr>)

pub fn nodes_mut<'a>(&'a mut self, container: &mut Vec<&'a mut Expr>)

Trait Implementations§

§

impl Add for Expr

§

type Output = Expr

The resulting type after applying the + operator.
§

fn add(self, rhs: Expr) -> <Expr as Add>::Output

Performs the + operation. Read more
§

impl AsRef<Expr> for AggExpr

§

fn as_ref(&self) -> &Expr

Converts this type into a shared reference of the (usually inferred) input type.
§

impl Clone for Expr

§

fn clone(&self) -> Expr

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for Expr

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl Default for Expr

§

fn default() -> Expr

Returns the “default value” for a type. Read more
§

impl Display for Expr

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl Div for Expr

§

type Output = Expr

The resulting type after applying the / operator.
§

fn div(self, rhs: Expr) -> <Expr as Div>::Output

Performs the / operation. Read more
source§

impl ExprEvalExtension for Expr

source§

fn cumulative_eval(self, expr: Expr, min_periods: usize, parallel: bool) -> Expr

Run an expression over a sliding window that increases 1 slot every iteration. Read more
§

impl From<&str> for Expr

§

fn from(s: &str) -> Expr

Converts to this type from the input type.
§

impl From<AggExpr> for Expr

§

fn from(agg: AggExpr) -> Expr

Converts to this type from the input type.
§

impl From<bool> for Expr

§

fn from(val: bool) -> Expr

Converts to this type from the input type.
§

impl From<f32> for Expr

§

fn from(val: f32) -> Expr

Converts to this type from the input type.
§

impl From<f64> for Expr

§

fn from(val: f64) -> Expr

Converts to this type from the input type.
§

impl From<i16> for Expr

§

fn from(val: i16) -> Expr

Converts to this type from the input type.
§

impl From<i32> for Expr

§

fn from(val: i32) -> Expr

Converts to this type from the input type.
§

impl From<i64> for Expr

§

fn from(val: i64) -> Expr

Converts to this type from the input type.
§

impl From<i8> for Expr

§

fn from(val: i8) -> Expr

Converts to this type from the input type.
§

impl From<u16> for Expr

§

fn from(val: u16) -> Expr

Converts to this type from the input type.
§

impl From<u32> for Expr

§

fn from(val: u32) -> Expr

Converts to this type from the input type.
§

impl From<u64> for Expr

§

fn from(val: u64) -> Expr

Converts to this type from the input type.
§

impl From<u8> for Expr

§

fn from(val: u8) -> Expr

Converts to this type from the input type.
§

impl Hash for Expr

§

fn hash<H>(&self, state: &mut H)where H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
§

impl<'a> IntoIterator for &'a Expr

§

type Item = &'a Expr

The type of the elements being iterated over.
§

type IntoIter = ExprIter<'a>

Which kind of iterator are we turning this into?
§

fn into_iter(self) -> <&'a Expr as IntoIterator>::IntoIter

Creates an iterator from a value. Read more
§

impl Mul for Expr

§

type Output = Expr

The resulting type after applying the * operator.
§

fn mul(self, rhs: Expr) -> <Expr as Mul>::Output

Performs the * operation. Read more
§

impl PartialEq for Expr

§

fn eq(&self, other: &Expr) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
§

impl Rem for Expr

§

type Output = Expr

The resulting type after applying the % operator.
§

fn rem(self, rhs: Expr) -> <Expr as Rem>::Output

Performs the % operation. Read more
§

impl Sub for Expr

§

type Output = Expr

The resulting type after applying the - operator.
§

fn sub(self, rhs: Expr) -> <Expr as Sub>::Output

Performs the - operation. Read more
§

impl TreeWalker for Expr

§

fn apply_children<'a>( &'a self, op: &mut dyn FnMut(&Expr) -> Result<VisitRecursion, PolarsError> ) -> Result<VisitRecursion, PolarsError>

§

fn map_children( self, _op: &mut dyn FnMut(Expr) -> Result<Expr, PolarsError> ) -> Result<Expr, PolarsError>

§

fn visit( &self, visitor: &mut dyn Visitor<Node = Self> ) -> Result<VisitRecursion, PolarsError>

Walks all nodes in depth-first-order.
§

fn rewrite( self, rewriter: &mut dyn RewritingVisitor<Node = Self> ) -> Result<Self, PolarsError>

§

impl Eq for Expr

§

impl StructuralPartialEq for Expr

Auto Trait Implementations§

§

impl !RefUnwindSafe for Expr

§

impl Send for Expr

§

impl Sync for Expr

§

impl Unpin for Expr

§

impl !UnwindSafe for Expr

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> DynClone for Twhere T: Clone,

source§

fn __clone_box(&self, _: Private) -> *mut ()

§

impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
§

impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
§

impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for Twhere T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

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

§

fn vzip(self) -> V

source§

impl<T, Rhs, Output> NumOps<Rhs, Output> for Twhere T: Sub<Rhs, Output = Output> + Mul<Rhs, Output = Output> + Div<Rhs, Output = Output> + Add<Rhs, Output = Output> + Rem<Rhs, Output = Output>,