polars.DataFrame.set_sorted#

DataFrame.set_sorted(
column: str,
*,
descending: bool = False,
) DataFrame[source]#

Indicate that one or multiple columns are sorted.

This can speed up future operations.

Parameters:
column

Column that are sorted

descending

Whether the columns are sorted in descending order.

Warning

This can lead to incorrect results if the data is NOT sorted!! Use with care!