Skip to content

LazyFrame.sort_values

sort_values

sort_values(
    by: str | list[str], inplace: Literal[False] = ...
) -> LazyFrame
sort_values(
    by: str | list[str], inplace: Literal[True] = ...
) -> None
sort_values(
    by: str | list[str], inplace: bool = False
) -> Union[LazyFrame, None]

Sort the relation by one or more columns.

Parameters:

Name Type Description Default
by str | list[str]

The column(s) to sort by.

required
inplace bool

Whether to modify the relation in place. Defaults to False.

False

Returns:

Type Description
Union[LazyFrame, None]

LazyFrame or None: A new LazyFrame if not inplace, otherwise None.