PositionIndex[list]
gives an association between unique elements in list and the positions at which they occur.
PositionIndex[assoc]
gives an association whose keys are the distinct values in assoc, and whose values are lists of the keys with which they are associated.


PositionIndex
PositionIndex[list]
gives an association between unique elements in list and the positions at which they occur.
PositionIndex[assoc]
gives an association whose keys are the distinct values in assoc, and whose values are lists of the keys with which they are associated.
Details

- In PositionIndex[expr], the keys in the result appear in the order of their first occurrence in expr.
See Also
Position StringPosition Tally DeleteDuplicates
Function Repository: KeyIndex PositionedCases
Related Guides
History
Text
Wolfram Research (2014), PositionIndex, Wolfram Language function, https://reference.wolfram.com/language/ref/PositionIndex.html.
CMS
Wolfram Language. 2014. "PositionIndex." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/PositionIndex.html.
APA
Wolfram Language. (2014). PositionIndex. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/PositionIndex.html
BibTeX
@misc{reference.wolfram_2025_positionindex, author="Wolfram Research", title="{PositionIndex}", year="2014", howpublished="\url{https://reference.wolfram.com/language/ref/PositionIndex.html}", note=[Accessed: 15-August-2025]}
BibLaTeX
@online{reference.wolfram_2025_positionindex, organization={Wolfram Research}, title={PositionIndex}, year={2014}, url={https://reference.wolfram.com/language/ref/PositionIndex.html}, note=[Accessed: 15-August-2025]}