PositionIndex
Disponible
Returns an association mapping each element to the list of its positions.
PositionIndex[list]
PositionIndex[assoc]
PositionIndex[{a, b, a, c, b}]
→ <|a -> {1, 3}, b -> {2, 5}, c -> {4}|>PositionIndex[<|1 -> a, 2 -> b, 3 -> c, 4 -> d, 5 -> c, 6 -> a|>]
→ <|a -> {1, 6}, b -> {2}, c -> {3, 5}, d -> {4}|> Les 6300 fonctions ·
Utiliser ceci depuis un client MCP