Position
Every position value occurs at in the collection.
✓ checked against that system · ! checked, with disagreements (hover a chip)Wolfram Language
Position✓Position(collection, value)every position value occurs at, each wrapped in its own .Typed signatures
| Type | Package | Applies |
|---|---|---|
(indexed_collection<T>, predicate: (T) any -> boolean) -> list<integer> where T: any | compute-engine | always |
(indexed_collection<any>, any) -> list<integer> | list<list<integer>> | combinatoricsreplaces compute-engine | always |
Details
- Wolfram's answer where IndexOf reports only the first occurrence, as a plain index.
- An empty when the value isn't present.
- Each position is a of indices, one per level: the search goes into nested collections, so is the third part of the second.
- Heads count as well, at index :
Position({{1}, {2}}, List)is{{0}, {1, 0}, {2, 0}}.
Examples
About
| Examples | 5 |
|---|---|
| Checked against | Wolfram Language 5 agree |
| Crosswalk | Wolfram Language |