Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Apply a function to neighboring pairs in a list
ResourceFunction["DifferencesBy"][list,f] applies f to successive neighboring pairs of element in list. | |
ResourceFunction["DifferencesBy"][f] represents an operator form of ResourceFunction["DifferencesBy"]. |
Find differences between images with respect to ImageDifference:
| In[1]:= |
| Out[1]= |
| In[2]:= |
| Out[2]= |
Use Complement to find the elements of each sublist that are absent from the proceeding sublist:
| In[3]:= |
| Out[3]= |
Create an operator:
| In[4]:= |
| Out[4]= |
| In[5]:= |
| Out[5]= |
Find vocabulary differences:
| In[6]:= | ![]() |
| Out[6]= |
Look at the growth of the string-based SubstitutionSystem:
| In[7]:= |
| Out[7]= | ![]() |
| In[8]:= |
| Out[8]= |
DifferencesBy is a generalization of Differences:
| In[9]:= |
| Out[9]= |
Using Subtract as f gives the same result:
| In[10]:= |
| Out[10]= |
The function passed to DifferencesBy does not need to be subtraction:
| In[11]:= |
| Out[11]= |
| In[12]:= |
| Out[12]= |
This work is licensed under a Creative Commons Attribution 4.0 International License