Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Take values larger than a threshold in a list or association
ResourceFunction["TakeLarger"][list,val,n] gives the smallest n elements in list that are larger than val. | |
ResourceFunction["TakeLarger"][list→prop,val,n] gives the property prop for the n elements in list larger than val. | |
ResourceFunction["TakeLarger"][val,n] represents an operator form of ResourceFunction["TakeLarger"] that can be applied to an expression. |
Take two numbers larger than the specified value in a list:
| In[1]:= |
| Out[1]= |
| In[2]:= |
| Out[2]= |
Do the same using the operator form of TakeLarger:
| In[3]:= |
| Out[3]= |
| In[4]:= |
| Out[4]= |
Take the smallest two values larger then the specified threshold in an association:
| In[5]:= |
| Out[5]= |
Take the smallest four numbers larger than the specified value, or as many as are available:
| In[6]:= |
| Out[6]= |
Take all numbers larger than a threshold:
| In[7]:= |
| Out[7]= |
Take two values in a list of Quantity objects:
| In[8]:= |
| Out[8]= |
Get the two smallest elements that are larger than 3 in a list:
| In[9]:= |
| Out[9]= |
Get the positions of the two smallest elements larger than 3:
| In[10]:= |
| In[11]:= |
| Out[11]= |
Get the elements along with their positions:
| In[12]:= |
| Out[12]= |
Let positions come first in the result:
| In[13]:= |
| Out[13]= |
Get associations containing the element and the position:
| In[14]:= |
| Out[14]= |
Get the two smallest planets with the radii larger than the Earth:
| In[15]:= |
| Out[15]= |
This work is licensed under a Creative Commons Attribution 4.0 International License