snowflake.snowpark.DataFrame.orderBy¶
- DataFrame.orderBy(*cols: ColumnOrName | Iterable[ColumnOrName], ascending: bool | int | List[bool | int] | None = None) DataFrame[source] (https://github.com/snowflakedb/snowpark-python/blob/release-v1.3.0/src/snowflake/snowpark/dataframe.py#L1137-L1228)¶
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.