gives the positions of the numerically largest value in list.
gives the positions of the first n largest values.
gives the positions of the n largest values in list as determined by orderfun.
- PositionLargest by default compares values by numerical magnitude, returning the list of positions of the largest value or n largest values.
- PositionLargest[list] gives a single list for the largest value.
- PositionLargest[list,n] gives a list of n sublists for the n largest values, or as many as are available if fewer than n.
- PositionLargest expects all objects to be comparable with one another, based on the ordering function.
Examplesopen allclose all
Basic Examples (2)
PositionLargest works with arbitrary numeric values:
PositionLargest can work with orderings of non-numeric data:
PositionLargest uses numeric ordering by default:
Properties & Relations (4)
PositionLargest gives positions of all the largest elements:
TakeLargest will only give as many element positions as are requested:
One must specify the count of maximal elements to get all positions corresponding to the largest element using TakeLargest:
One can use Ordering once the number of largest elements is known:
FindPeaks locates positions of all local maximal values:
Wolfram Research (2022), PositionLargest, Wolfram Language function, https://reference.wolfram.com/language/ref/PositionLargest.html.
Wolfram Language. 2022. "PositionLargest." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/PositionLargest.html.
Wolfram Language. (2022). PositionLargest. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/PositionLargest.html