Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Map a function for elements in a list when a test gives True
ResourceFunction["MapIf"][f,test,list] applies f to only those values ei in list for which test[ei] gives True. | |
ResourceFunction["MapIf"][f,test] is the operator form of MapIf. |
Apply a function only for values greater than five:
In[1]:= |
Out[1]= |
Use the operator form:
In[2]:= |
Out[2]= |
Apply a function only for arguments of certain head:
In[3]:= |
Out[3]= |
Get values for associations of length 2:
In[4]:= |
Out[4]= |
Avoid error messages when there is no data available:
In[5]:= |
Out[5]= |
Wolfram Language 11.3 (March 2018) or above
This work is licensed under a Creative Commons Attribution 4.0 International License