polars.LazyFrame.sort

LazyFrame.sort(by: Union[str, polars.internals.expr.Expr, List[str], List[polars.internals.expr.Expr]], reverse: Union[bool, List[bool]] = False, nulls_last: bool = False) polars.internals.lazy_frame.LDF

Sort the DataFrame by:

  • A single column name

  • An expression

  • Multiple expressions

Parameters
by

Column (expressions) to sort by.

reverse

Sort in descending order.

nulls_last

Place null values last. Can only be used if sorted by a single column.