Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Drop the smallest values from a list
ResourceFunction["DropSmallest"][list,n] drops the smallest n numbers from list. | |
ResourceFunction["DropSmallest"][n] represents the operator form of ResourceFunction["DropSmallest"]. |
Drops the smallest two values:
In[1]:= | ![]() |
Out[1]= | ![]() |
Use the operator form, by first creating an operator op:
In[2]:= | ![]() |
Out[2]= | ![]() |
Apply the operator:
In[3]:= | ![]() |
Out[3]= | ![]() |
With n=0, nothing is deleted:
In[4]:= | ![]() |
Out[4]= | ![]() |
A negative number deletes the largest n numbers:
In[5]:= | ![]() |
Out[5]= | ![]() |
If n is larger than the length of the list then an empty list is returned:
In[6]:= | ![]() |
Out[6]= | ![]() |
DropSmallest is complementary to TakeSmallest:
In[7]:= | ![]() |
In[8]:= | ![]() |
Out[8]= | ![]() |
In[9]:= | ![]() |
Out[9]= | ![]() |
This work is licensed under a Creative Commons Attribution 4.0 International License