Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Get the position of the largest elements in a list
ResourceFunction["PositionLargest"][list] gives the position of the first element that has the largest value in list. | |
ResourceFunction["PositionLargest"][list,n] gives the positions of the first n largest values. |
Find a position of the largest value in a list:
In[1]:= |
Out[1]= |
Specify the number of positions to find:
In[2]:= |
Out[2]= |
Get a list of positions for the three largest values:
In[3]:= |
Out[3]= |
Use UpTo to find the position of the two largest moons orbiting each planet:
In[4]:= |
Out[4]= |
In[5]:= |
Out[5]= |
Wolfram Language 11.3 (March 2018) or above
This work is licensed under a Creative Commons Attribution 4.0 International License