List#

The following methods are available under the expr.list attribute.

Expr.list.all()

Evaluate whether all boolean values in a list are true.

Expr.list.any()

Evaluate whether any boolean value in a list is true.

Expr.list.arg_max()

Retrieve the index of the maximum value in every sublist.

Expr.list.arg_min()

Retrieve the index of the minimal value in every sublist.

Expr.list.concat(other)

Concat the arrays in a Series dtype List in linear time.

Expr.list.contains(item)

Check if sublists contain the given item.

Expr.list.count_match(element)

Count how often the value produced by element occurs.

Expr.list.diff([n, null_behavior])

Calculate the n-th discrete difference of every sublist.

Expr.list.eval(expr, *[, parallel])

Run any polars expression against the lists' elements.

Expr.list.explode()

Returns a column with a separate row for every list element.

Expr.list.first()

Get the first value of the sublists.

Expr.list.get(index)

Get the value by index in the sublists.

Expr.list.head([n])

Slice the first n values of every sublist.

Expr.list.join(separator)

Join all string items in a sublist and place a separator between them.

Expr.list.last()

Get the last value of the sublists.

Expr.list.lengths()

Get the length of the arrays as UInt32.

Expr.list.max()

Compute the max value of the lists in the array.

Expr.list.mean()

Compute the mean value of the lists in the array.

Expr.list.min()

Compute the min value of the lists in the array.

Expr.list.reverse()

Reverse the arrays in the list.

Expr.list.set_difference(other)

Compute the SET DIFFERENCE between the elements in this list and the elements of other.

Expr.list.set_intersection(other)

Compute the SET INTERSECTION between the elements in this list and the elements of other.

Expr.list.set_symmetric_difference(other)

Compute the SET SYMMETRIC DIFFERENCE between the elements in this list and the elements of other.

Expr.list.set_union(other)

Compute the SET UNION between the elements in this list and the elements of other.

Expr.list.shift([periods])

Shift values by the given period.

Expr.list.slice(offset[, length])

Slice every sublist.

Expr.list.sort(*[, descending])

Sort the arrays in this column.

Expr.list.sum()

Sum all the lists in the array.

Expr.list.tail([n])

Slice the last n values of every sublist.

Expr.list.take(index, *[, null_on_oob])

Take sublists by multiple indices.

Expr.list.to_struct([n_field_strategy, ...])

Convert the series of type List to a series of type Struct.

Expr.list.unique(*[, maintain_order])

Get the unique/distinct values in the list.