polars.internals.expr.ExprListNameSpace.reverse

ExprListNameSpace.reverse() polars.internals.expr.Expr

Reverse the arrays in the list

Examples

>>> df = pl.DataFrame(
...     {
...         "a": [[3, 2, 1], [9, 1, 2]],
...     }
... )
>>> df.select(pl.col("a").arr.reverse())
shape: (2, 1)
┌────────────┐
│ a          │
│ ---        │
│ list [i64] │
╞════════════╡
│ [1, 2, 3]  │
├╌╌╌╌╌╌╌╌╌╌╌╌┤
│ [2, 1, 9]  │
└────────────┘