Return the row indices that would sort the columns.
Column(s) to arg sort by. Accepts expression input.
Sort in descending order. When sorting by multiple columns, can be specified per column by passing a sequence of booleans.
const df = pl.DataFrame({"a": [0, 1, 1, 0], "b": [3, 2, 3, 2],});df.select(pl.argSortBy(pl.col("a")));shape: (4, 1)┌─────┐│ a ││ --- ││ u32 │╞═════╡│ 0 ││ 3 ││ 1 ││ 2 │└─────┘ Copy
const df = pl.DataFrame({"a": [0, 1, 1, 0], "b": [3, 2, 3, 2],});df.select(pl.argSortBy(pl.col("a")));shape: (4, 1)┌─────┐│ a ││ --- ││ u32 │╞═════╡│ 0 ││ 3 ││ 1 ││ 2 │└─────┘
Return the row indices that would sort the columns.