snowflake.snowpark.DataFrame.sort¶
- DataFrame.sort(*cols: ColumnOrName | Iterable[ColumnOrName], ascending: bool | int | List[bool | int] | None = 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.