polars.internals.expr.list.ExprListNameSpace.tail#

ExprListNameSpace.tail(n: int = 5) Expr[source]#

Slice the last n values of every sublist.

Parameters:
n

Number of values to return for each sublist.

Examples

>>> s = pl.Series("a", [[1, 2, 3, 4], [10, 2, 1]])
>>> s.arr.tail(2)
shape: (2,)
Series: 'a' [list]
[
    [3, 4]
    [2, 1]
]