snowflake.snowpark.functions.desc_nulls_last¶
- snowflake.snowpark.functions.desc_nulls_last(c: Union[Column, str]) Column [source] (https://github.com/snowflakedb/snowpark-python/blob/v1.26.0/snowpark-python/src/snowflake/snowpark/functions.py#L7245-L7264)¶
Returns a Column expression with values sorted in descending order (null values sorted after non-null values).
- Example::
>>> df = session.create_dataframe([1, 2, 3, None, None], schema=["a"]) >>> df.sort(desc_nulls_last(df["a"])).collect() [Row(A=3), Row(A=2), Row(A=1), Row(A=None), Row(A=None)]