cudf.Series.sort_values#
- Series.sort_values(axis=0, ascending=True, inplace=False, kind='quicksort', na_position='last', ignore_index=False)#
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.
- Returns
- SeriesSeries with sorted values.
Notes
- Difference from pandas:
Support axis=’index’ only.
Not supporting: inplace, kind
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