Services & Resources / Wolfram Forums
MathGroup Archive
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2004

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Partition of multi dimension list

  • To: mathgroup at
  • Subject: [mg52807] Re: Partition of multi dimension list
  • From: "Ray Koopman" <koopman at>
  • Date: Mon, 13 Dec 2004 04:23:40 -0500 (EST)
  • References: <cpeje6$6sb$>
  • Sender: owner-wri-mathgroup at

Bruyndonckx P. wrote:
> I have a list of about 5 million items.  Each item is a list of
> 7 integer numbers (hence a 5000000x7 array).  I want to partition
> this array on the values of two numbers in each item.  The third
> number (out of seven) goes from 0 to 63 and the fifth number is
> either 0 or 1.  So I want to end up with 64*2 partitions.  The
> fastest solution I have found up to now to do this on the list 'c'
> is Flatten[CategoryLists[c, {_}, {_}, Range[64] - 1, {_}, {0,1},
> {_}, {_}][[1, 1]], 4].

Split[Sort[c, OrderedQ[{#1[[{3,5}]],#2[[{3,5}]]}]&],

  • Prev by Date: Re: Solve question
  • Next by Date: GUIKit, Mathematica 5.1
  • Previous by thread: Re: Partition of multi dimension list
  • Next by thread: Iteration of Initial Conditions for required Boundary Value with NDSolve