dask.dataframe.DataFrame.sort_values
- DataFrame.sort_values(by, npartitions=None, ascending=True, **kwargs)[source]
Sort the dataset by a single column.
Sorting a parallel dataset requires expensive shuffles and is generally not recommended. See
set_index
for implementation details.- Parameters
- by: string
- npartitions: int, None, or ‘auto’
The ideal number of output partitions. If None, use the same as the input. If ‘auto’ then decide by memory use.
- ascending: bool, optional
Non ascending sort is not supported by Dask. Defaults to True.
Examples
>>> df2 = df.sort_values('x')