I'm trying to sort a list of lists. The sublists are defined in length, but the length of the list containing it varies.
A simplified set might be: {{1, 2, 3}, {7, 1, 4}, {3, 5, 6}, {10, 7, 1}} but
{{1, 2, 3}, {7, 1, 4}, {3, 5, 6}, {10, 7, 1}}
but it could be: a={{1, 2, 3}, {7, 1, 4}, {3, 5, 6}, {10, 7, 1}, {12, 4, 8}}
a={{1, 2, 3}, {7, 1, 4}, {3, 5, 6}, {10, 7, 1}, {12, 4, 8}}
Sorting on the last element is built-in using
SortBy[a,Last];
SortBy[a,Last];
How do I sort on an arbitrary element? In the example, the second.