snowflake.snowpark.DataFrame.orderBy¶
- DataFrame.orderBy(*cols: Union[Column, str, Iterable[Union[Column, str]]], ascending: Optional[Union[bool, int, List[Union[bool, int]]]] = None) DataFrame[source]¶
Sorts a DataFrame by the specified expressions (similar to ORDER BY in SQL).
Examples:
- Parameters:
*cols – A column name as
strorColumn, or a list of columns to sort by.ascending – A
boolor a list ofboolfor sorting the DataFrame, whereTruesorts a column in ascending order andFalsesorts a column in descending order . If you specify a list of multiple sort orders, the length of the list must equal the number of columns.