Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Drop the largest values from a list
ResourceFunction["DropLargest"][list,n] drops the largest n numbers from list. | |
ResourceFunction["DropLargest"][n] represents an operator form of ResourceFunction["DropLargest"] that can be applied to an expression. |
Drop the largest 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]= | ![]() |
When n=0, nothing is deleted:
In[4]:= | ![]() |
Out[4]= | ![]() |
A negative number deletes the smallest n numbers:
In[5]:= | ![]() |
Out[5]= | ![]() |
If n is larger than the length of the list, an empty list is returned:
In[6]:= | ![]() |
Out[6]= | ![]() |
DropLargest is complementary with TakeLargest:
In[7]:= | ![]() |
In[8]:= | ![]() |
Out[8]= | ![]() |
In[9]:= | ![]() |
Out[9]= | ![]() |
This work is licensed under a Creative Commons Attribution 4.0 International License