Qurak

PositionIndex

ใช้งานได้

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}|>

หัวข้อ

ที่เกี่ยวข้อง

ฟังก์ชันทั้งหมด 6300 รายการ · ใช้สิ่งนี้จากไคลเอนต์ MCP