Sort rowsπ
Sorts matrices and tables according to a key.
Inputsπ
inputX
: A matrix or table to be sorted. X ranges from 0 to dynamicInputCount - 1. The number of rows in each input matrix must be divisible by the number of rows in the key column. If N is the number of rows in an input matrix and M is the number of rows in the key column with N = k * M, then the sorting is applied to blocks of k rows.keyColumn
: The (zero-based) index of a sort key in input0. All output matrices, including input0, will be sorted based on values on this column.order
: Sorting order.algorithm
: Sorting algorithm.locale
: The locale used for string sorting. The βCβ locale commonly used in programming is identical to βen_USβ. An empty value means the locale will be automatically chosen based on the settings of the userβs operating system.ignorePunctuation
: Iftrue
, punctuation characters and symbols are ignored when determining sort order. Otherwise, they are treated as sortable characters. Iffalse
, the behavior depends on locale.caseSensitive
: Iftrue
, the string sorting algorithm is case sensitive. Otherwise, the case is ignored. Notice that case is used only for breaking the tie between otherwise identical strings. For example, βabcβ < βABCβ but βABC0β < βabc1β.
Outputsπ
permutation
: A matrix that stores the original index of each row in the input matrix.outputX
: A matrix or table that contains the rows received in inputX, sorted according to values of the key column.
Locale codesπ
If you need to manually craft a locale code, the format is βlanguage[_script][_country]β, where:
language is a lowercase, two-letter, ISO 639 language code (also some three-letter codes),
script is a titlecase, four-letter, ISO 15924 script code,
country is an uppercase, two-letter, ISO 3166 country code (also β419β as defined by United Nations), and codeset and modifier are ignored.
-
enum
Order
π Sorting order.
Values:
-
enumerator
Ascending
π Sort in ascending order.
-
enumerator
Descending
π Sort in descending order.
-
enumerator
-
enum
Algorithm
π Sorting algorithm.
Values:
-
enumerator
NumericSort
π Input values are converted to numbers before sorting.
If an input value is a string which can not be converted to a number, the value is treated as if it was zero.
-
enumerator
StringSort
π Input values are converted to strings before sorting and string ordering rules are applied.
For example, β100β is less than β99β.
-
enumerator