|
SOLUTIONS
|
BUILT-IN MATHEMATICA SYMBOL
SplitBy
SplitBy[list, f]
splits list into sublists consisting of runs of successive elements that give the same value when f is applied.
SplitBy[list, {f1, f2, ...}]
recursively splits list into sublists by testing elements successively with each of the
.
ExamplesExamplesopen allclose all
Basic Examples (3)Basic Examples (3)
Split into runs of numbers with identical integer part:
| In[1]:= |
| Out[1]= |
Split into runs of triples with identical first component:
| In[1]:= |
| Out[1]= |
Split first by their first component and then by their second:
| In[2]:= |
| Out[2]= |
Split dates into runs with identical year:
| In[1]:= |
| Out[1]= | ![]() |
| In[2]:= |
| Out[2]= | ![]() |
New in 7
Mathematica 9 is now available!
New to Mathematica?
Find your learning path »
Have a question?
Ask support »


