cudf.Series.sort_values#

Series.sort_values(axis=0, ascending=True, inplace=False, kind='quicksort', na_position='last', ignore_index=False, key=None)[source]#

Sort by the values along either axis.

Parameters:
ascendingbool or list of bool, default True

Sort ascending vs. descending. Specify list for multiple sort orders. If this is a list of bools, must match the length of the by.

na_position{‘first’, ‘last’}, default ‘last’

‘first’ puts nulls at the beginning, ‘last’ puts nulls at the end

ignore_indexbool, default False

If True, index will not be sorted.

keycallable, optional

Apply the key function to the values before sorting. This is similar to the key argument in the builtin sorted function, with the notable difference that this key function should be vectorized. It should expect a Series and return a Series with the same shape as the input. It will be applied to each column in by independently. Currently not supported.

Returns:
SeriesSeries with sorted values.

Examples

>>> import cudf
>>> s = cudf.Series([1, 5, 2, 4, 3])
>>> s.sort_values()
0    1
2    2
4    3
3    4
1    5
dtype: int64

Pandas Compatibility Note

pandas.Series.sort_values()

  • Support axis=’index’ only.

  • The inplace and kind argument is currently unsupported