List#

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

Series.list.all()

Evaluate whether all boolean values in a list are true.

Series.list.any()

Evaluate whether any boolean value in a list is true.

Series.list.drop_nulls()

Drop all null values in the list.

Series.list.arg_max()

Retrieve the index of the maximum value in every sublist.

Series.list.arg_min()

Retrieve the index of the minimal value in every sublist.

Series.list.concat(other)

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

Series.list.contains(item)

Check if sublists contain the given item.

Series.list.count_match(element)

Count how often the value produced by element occurs.

Series.list.count_matches(element)

Count how often the value produced by element occurs.

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

Calculate the first discrete difference between shifted items of every sublist.

Series.list.difference(other)

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

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

Run any polars expression against the lists' elements.

Series.list.explode()

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

Series.list.first()

Get the first value of the sublists.

Series.list.gather(indices, *[, null_on_oob])

Take sublists by multiple indices.

Series.list.get(index)

Get the value by index in the sublists.

Series.list.head([n])

Slice the first n values of every sublist.

Series.list.join(separator)

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

Series.list.intersection(other)

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

Series.list.last()

Get the last value of the sublists.

Series.list.len()

Return the number of elements in each list.

Series.list.lengths()

Return the number of elements in each list.

Series.list.max()

Compute the max value of the arrays in the list.

Series.list.mean()

Compute the mean value of the arrays in the list.

Series.list.min()

Compute the min value of the arrays in the list.

Series.list.reverse()

Reverse the arrays in the list.

Series.list.sample([n, fraction, ...])

Sample from this list.

Series.list.set_difference(other)

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

Series.list.set_intersection(other)

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

Series.list.set_symmetric_difference(other)

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

Series.list.set_union(other)

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

Series.list.shift([n])

Shift list values by the given number of indices.

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

Slice every sublist.

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

Sort the arrays in this column.

Series.list.sum()

Sum all the arrays in the list.

Series.list.symmetric_difference(other)

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

Series.list.tail([n])

Slice the last n values of every sublist.

Series.list.take(indices, *[, null_on_oob])

Take sublists by multiple indices.

Series.list.to_array(width)

Convert a List column into an Array column with the same inner data type.

Series.list.to_struct([n_field_strategy, fields])

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

Series.list.union(other)

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

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

Get the unique/distinct values in the list.