Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Get the minimal item in terms of canonical ordering
ResourceFunction["Minimal"][list] returns the canonically minimal item in list. | |
ResourceFunction["Minimal"][list,f] uses the ordering function f. |
Using canonical ordering, return the minimal item:
| In[1]:= |
| Out[2]= |
Sort the items:
| In[3]:= |
| Out[3]= |
The numeric minimum is different:
| In[4]:= |
| Out[4]= |
Use a different ordering function to obtain the same result:
| In[5]:= |
| Out[5]= |
Use Minimal on an association:
| In[6]:= |
| Out[6]= |
Use Minimal on a sparse vector:
| In[7]:= |
| Out[7]= |
Find the item with the smallest second item using an ordering function:
| In[8]:= |
| Out[8]= |
The result of the function MinimalBy has a similar form:
| In[9]:= |
| Out[9]= |
This work is licensed under a Creative Commons Attribution 4.0 International License