Skip to content

MinimalBy

Status: Stable

documented, exercised by the test suite and/or worked examples, with no known limitations recorded.

Description

MinimalBy[list, f]
    Gives the element(s) of list for which f is minimal
    (all ties, in order). Over an association, gives the entries whose
    value minimises f. MinimalBy[f] is the operator form.

Examples

All examples below are verified against the current Mathilda build.

In[1]:= MaximalBy[{1, -5, 3, -5, 2}, Abs]
Out[1]= {-5, -5}

In[2]:= MinimalBy[<|"a" -> 1, "b" -> 3, "c" -> 2|>, Identity]
Out[2]= <|"a" -> 1|>

Implementation notes

Attributes: Protected.

Implementation status

Stable — documented, exercised by the test suite and/or worked examples, with no known limitations recorded.

References