SortBy
The collection sorted by the value of a function on each element.
✓ checked against that system · ! checked, with disagreements (hover a chip)Wolfram Language
SortBy!SortBy(collection, f)sorted by , ascending; elements with equal keys come out in canonical order. SortBy(c, [f]), with the key function in a list, is stable, keeping input order on ties.Typed signatures
| Type | Package | Applies |
|---|---|---|
(collection<T>, any) -> collection<T> where T | combinatorics | always |
Examples
Basic #
Equal sort keys now follow Wolfram's tie order (our own convention changing, not a known value).
live ↗InOut
live ↗
InOut
Scope #
live ↗
InOut
live ↗
InOut
live ↗
InOut
A list of key functions sorts by each in turn and keeps input order for what ties on all of them
live ↗InOut
live ↗
InOut
live ↗
InOut
About
| Examples | 18 |
|---|---|
| Checked against | Wolfram Language 17 agree1 differ |
| Crosswalk | Wolfram Language |