MathGroup Archive 2008

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

Search the Archive

Re: List re-arrangement question

  • To: mathgroup at
  • Subject: [mg87773] Re: List re-arrangement question
  • From: Jean-Marc Gulliet <jeanmarc.gulliet at>
  • Date: Wed, 16 Apr 2008 22:31:23 -0400 (EDT)
  • Organization: The Open University, Milton Keynes, UK
  • References: <fu4fkm$nip$>

Yaroslav Bulatov wrote:

> I'm trying to do something like the following:
> Transpose[{{{a1, a2, a3}, {a1}, {a1, a2, a3}}, {{b1, b2, b3}, {b1},
> {b1, b2, b3}}}, {3, 1, 2}]
> expecting to get:
> {{{a1, b1}, {a2, b2}, {a3, b3}}, {{a1, b1}}, {{a1, b1}, {a2, b2}, {a3,
> b3}}}
> However, it looks like Transpose doesn't work with "ragged"
> what is the recommended Mathematica style to do the above
> transformation?

Here are some possible ways:


Thread /@ Thread@rag

MapThread[Thread[{##}] &, rag]

MapThread[Transpose[{##}] &, rag]


-- Jean-Marc

  • Prev by Date: Re: Select from list
  • Next by Date: Re: PolarPlot
  • Previous by thread: Re: List re-arrangement question
  • Next by thread: Select from list