User | Kudos |
---|---|
8 | |
6 | |
5 | |
4 | |
3 |
I often find myself having to sort the rows of a 2D array based on a one of the columns. It would be nice to be able to have a native function for that. Currently I turn each row into a cluster, sort the array of clusters, then convert back to a 2D array -- way too much overhead and wiring time.
Instead, I envision something like Matlab's sortrows or Excel's expand selection.
Inputs would be a 2D array, a column index, and an ascending/descending selector. Output would be the 2D array with rows reordered such that the specified column is sorted.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.