polars.LazyFrame.set_sorted#

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

Indicate that one or multiple columns are sorted.

This can speed up future operations.

Parameters:
column

Columns 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!