Mathematica 9 is now available
THIS IS DOCUMENTATION FOR AN OBSOLETE PRODUCT.
SEE THE DOCUMENTATION CENTER FOR THE LATEST INFORMATION.
Mathematica > Core Language > List Manipulation > Rearranging & Restructuring Lists > SplitBy >
Mathematica > Data Manipulation > Handling Arrays of Data > Rearranging & Restructuring Lists > SplitBy >
Mathematica > Data Manipulation > Image Processing & Analysis > Basic Image Manipulation > Handling Arrays of Data > Rearranging & Restructuring Lists > SplitBy >

SplitBy

SplitBy
splits list into sublists consisting of runs of successive elements that give the same value when f is applied.
SplitBy
recursively splits list into sublists by testing elements successively with each of the .
  • SplitBy splits but does not rearrange list.
  • SplitBy performs comparisons only on adjacent pairs of elements.
Split into runs of numbers with identical integer part:
Split into runs of triples with identical first component:
Split first by their first component and then by their second:
Split dates into runs with identical year:
Split into runs of numbers with identical integer part:
In[1]:=
Click for copyable input
Out[1]=
 
Split into runs of triples with identical first component:
In[1]:=
Click for copyable input
Out[1]=
Split first by their first component and then by their second:
In[2]:=
Click for copyable input
Out[2]=
 
Split dates into runs with identical year:
In[1]:=
Click for copyable input
Out[1]=
In[2]:=
Click for copyable input
Out[2]=
New in 7
Ask a question about this page  |  Suggest an improvement  |  Leave a message for the team
Format:   HTML  |  CDF