polars.LazyFrame.set_sorted#

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

Flag a column as sorted.

This can speed up future operations.

Parameters:
column

Column that is sorted

descending

Whether the column is sorted in descending order.

Warning

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