Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Partition list satisfying conditions

Hi, I am looking for a function which will partition a list. For a simple example, suppose I have the list [1,2,3,4,5,6]. Suppose I want all the even integers in one list and the odd integers in another. Is there a function that can do this, and perhaps yeild something like [[1,3,5],[2,4,6]]? In this case, the number of partitions is 2, so it is fairly easy, but in my problem the number is not known. In mathematica, the function I want is called GatherBy.