turicreate.SArray.sort — Turi Create API 6.4.1 documentation (original) (raw)

Turi Create API


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]