MathGroup Archive 2005

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

Search the Archive

Re: opposite of partition

  • To: mathgroup at
  • Subject: [mg57581] Re: opposite of partition
  • From: Paul Abbott <paul at>
  • Date: Wed, 1 Jun 2005 06:03:30 -0400 (EDT)
  • Organization: The University of Western Australia
  • References: <d7han9$3r7$>
  • Sender: owner-wri-mathgroup at

In article <d7han9$3r7$1 at>,
 Guy Israeli <guyi1 at> wrote:

> How do I do the opposite of partition quickly?
> for example:
> l1= {{a, b, c, d, e}, {f, g, h, i, j}, {k, l, m, n, o}, {p, q, r, s, t}, {u, 
> v, w,
> x, y}}
> and then if I partition it to blocks will result in
> {{{{a, b}, {f, g}}, {{c, d}, {h, i}}}, {{{k, l}, {p, q}}, {{m, n}, {r, s}}}}

You have used

 m2 = Partition[l1, {2,2}, {2,2}]

here, and you have lost matrix entries as a result.
> flattening it won't help, and its messy to do it by taking all first lines 
> of the blocks, then second..
> How can I do it quickly?

In this case,



does what you want.


Paul Abbott                                      Phone: +61 8 6488 2734
School of Physics, M013                            Fax: +61 8 6488 1014
The University of Western Australia         (CRICOS Provider No 00126G)    

  • Prev by Date: Re: List searching
  • Next by Date: Re: opposite of partition
  • Previous by thread: Re: opposite of partition
  • Next by thread: Re: opposite of partition