Agrupamiento de Elementos

Partition[list, n] particiona list en pedazos den-elementos
Partition[list, n, d] utiliza un offset d para pedazos sucesivos
Split[list] fragmenta list en pedazos que están hechos de secuencias de elementos idénticos

In[39]:=

t = {a, b, c, d, e, f, g}

Out[39]=

{a, b, c, d, e, f, g}

In[40]:=

Partition[t, 2]

Out[40]=

{{a, b}, {c, d}, {e, f}}

In[41]:=

Partition[t, 3]

Out[41]=

{{a, b, c}, {d, e, f}}

In[42]:=

Partition[t, 3, 1]

Out[42]=

{{a, b, c}, {b, c, d}, {c, d, e}, {d, e, f}, {e, f, g}}

In[43]:=

Split[{a, a, b, b, b, a, a, a, b}]

Out[43]=

{{a, a}, {b, b, b}, {a, a, a}, {b}}

In[44]:=

t=.


Created by Mathematica  (August 6, 2004)