Functions#
These functions are available from the polars module root and can be used as expressions, and sometimes also in eager contexts.
Available in module namespace:
|
Either return an expression representing all columns, or evaluate a bitwise AND operation. |
|
Compute the bitwise AND horizontally across columns. |
|
Evaluate a bitwise OR operation. |
|
Compute the bitwise OR horizontally across columns. |
|
Apply a custom/user-defined function (UDF) in a GroupBy context. |
|
Approximate count of unique values. |
|
Generate a range of integers. |
|
Compute two argument arctan in radians. |
|
Compute two argument arctan in degrees. |
|
Return the row indices that would sort the columns. |
Return indices where condition evaluates True. |
|
|
Alias for mean. |
|
Folds the columns from left to right, keeping the first non-null value. |
|
Horizontally concatenate columns into a single list column. |
|
Horizontally concatenate columns into a single string column. |
|
Compute the Pearson's or Spearman rank correlation correlation between two columns. |
|
Count the number of values in this column/context. |
|
Compute the covariance between two columns/ expressions. |
|
Cumulatively accumulate over multiple columns horizontally/ row wise with a left fold. |
|
Cumulatively accumulate over multiple columns horizontally/ row wise with a left fold. |
|
Cumulatively sum all values. |
|
Cumulatively sum all values horizontally across columns. |
|
Create a Polars literal expression of type Date. |
|
Create a Polars literal expression of type Datetime. |
Generate a date range. |
|
Create a column of date ranges. |
|
|
Create polars Duration from distinct time components. |
|
Alias for an element being evaluated in an eval expression. |
|
Represent all columns except for the given columns. |
|
Get the first value. |
|
Accumulate over multiple columns horizontally/ row wise with a left fold. |
|
Format expressions as a string. |
Utility function that parses an epoch timestamp (or Unix time) to Polars Date(time). |
|
|
Syntactic sugar for pl.col("foo").agg_groups(). |
|
Get the first n rows. |
|
Aggregate all column values into a list. |
Generate a range of integers. |
|
Generate a range of integers for each row of the input columns. |
|
|
Get the last value. |
|
Return an expression representing a literal value. |
|
Map a custom function over multiple columns/expressions. |
|
Get the maximum value. |
|
Get the maximum value horizontally across columns. |
|
Get the mean value. |
|
Get the median value. |
|
Get the minimum value. |
|
Get the minimum value horizontally across columns. |
|
Count unique values. |
|
Construct a column of length n filled with ones. |
|
Syntactic sugar for pl.col("foo").quantile(..). |
|
Accumulate over multiple columns horizontally/ row wise with a left fold. |
|
Construct a column of length n filled with the given value. |
|
Compute the rolling correlation between two columns/ expressions. |
|
Compute the rolling covariance between two columns/ expressions. |
|
Run polars expressions without a context. |
|
Get the standard deviation. |
|
Collect columns into a struct column. |
|
Sum all values. |
|
Sum all values horizontally across columns. |
|
Parse one or more SQL expressions to polars expression(s). |
|
Get the last n rows. |
|
Create a Polars literal expression of type Time. |
Generate a time range. |
|
Create a column of time ranges. |
|
|
Get the variance. |
|
Start a when-then-otherwise expression. |
|
Construct a column of length n filled with zeros. |
Available in expression namespace:
|
Check if all boolean values in a Boolean column are True. |
|
Check if any boolean value in a Boolean column is True. |
|
Apply a custom/user-defined function (UDF) in a GroupBy or Projection context. |
Approximate count of unique values. |
|
Count the number of values in this expression. |
|
|
Get an array with the cumulative sum computed at every element. |
|
Exclude columns from a multi-column expression. |
Get the first value. |
|
|
Get the first n rows. |
Aggregate values into a list. |
|
|
Apply a custom python function to a Series or sequence of Series. |
|
Get maximum value. |
Get mean value. |
|
Get median value using linear interpolation. |
|
|
Get minimum value. |
Count unique values. |
|
|
Get quantile value. |
|
Get standard deviation. |
|
Get sum value. |
|
Get the last n rows. |
|
Get variance. |