Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Find indices of parts satisfying a criterion
ResourceFunction["SelectIndices"][list,crit] gives indices of elements ei of list for which crit[ei] yields True. | |
ResourceFunction["SelectIndices"][crit] is the operator form of ResourceFunction["SelectIndices"]. |
Select indices of even elements:
In[1]:= | ![]() |
Out[1]= | ![]() |
The operator form of SelectIndices:
In[2]:= | ![]() |
Out[2]= | ![]() |
Select indices of a List:
In[3]:= | ![]() |
Out[3]= | ![]() |
Select indices of an expression with an arbitrary head:
In[4]:= | ![]() |
Out[4]= | ![]() |
Keys of an Association:
In[5]:= | ![]() |
Out[5]= | ![]() |
Indices of a SparseArray:
In[6]:= | ![]() |
Out[6]= | ![]() |
In[7]:= | ![]() |
Out[7]= | ![]() |
Use SelectIndices in operator form:
In[8]:= | ![]() |
Out[8]= | ![]() |
Wolfram Language 11.3 (March 2018) or above
This work is licensed under a Creative Commons Attribution 4.0 International License