Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Find sublists satisfying a criterion
ResourceFunction["SequenceSelect"][{e1,e2,…},crit] gives the sublists in the list for which crit[{ei,ej,…}] is True. | |
ResourceFunction["SequenceSelect"][{e1,e2,…},crit,n] picks out the first n results. |
Find sequences in a list of integers that have a specific mean:
In[1]:= |
Out[1]= |
Find sets of colors all significantly different than Red:
In[2]:= |
Out[2]= |
Find sublists of length three with a total over seven:
In[3]:= |
Out[3]= |
Find up to five sublists of strings with a specific total length:
In[4]:= |
Out[4]= |
By default the results do not include overlapping sublists:
In[5]:= |
Out[5]= |
Use Overlaps→True to include overlapping sublists:
In[6]:= |
Out[6]= |
Use Overlaps→All to include overlapping sublists and multiple sublists with the same starting element:
In[7]:= |
Out[7]= |
SequenceCases matches patterns:
In[8]:= |
Out[8]= |
SequencePattern checks a test:
In[9]:= |
Out[9]= |
This work is licensed under a Creative Commons Attribution 4.0 International License