turicreate.SArray.sort

SArray.sort(ascending=True)

Sort all values in this SArray.

Sort only works for sarray of type str, int and float, otherwise TypeError will be raised. Creates a new, sorted SArray.

Parameters:
ascending: boolean, optional

If true, the sarray values are sorted in ascending order, otherwise, descending order.

Returns:
out: SArray

Examples

>>> sa = SArray([3,2,1])
>>> sa.sort()
dtype: int
Rows: 3
[1, 2, 3]