KeySortBy

KeySortBy[assoc,f]

sorts the elements of an association in the order defined by applying f to each of their keys.

KeySortBy[f]

represents an operator form of KeySortBy that can be applied to an expression.

Details

Examples

Basic Examples  (5)

Sort the association entries by keys in reverse order:

Sort the association by its keys modulo 3:

Sort the entries by the length of their keys:

Sort a list of rules:

Use the operator form of KeySortBy:

Introduced in 2014
 (10.0)