Services & Resources / Wolfram Forums / MathGroup Archive

MathGroup Archive 2012

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

Search the Archive

List Manipulation

  • To: mathgroup at
  • Subject: [mg124895] List Manipulation
  • From: Murta <rodrigomurtax at>
  • Date: Sat, 11 Feb 2012 06:36:12 -0500 (EST)
  • Delivered-to:

Hi All

I'm looking some better solution for the below list manipulation:
output = {{a,1},{a,2},{a,3},{b,4},{b,5},{b,6},{c,7},{c,8},{c,9}}
It's a simple distributions of terms.

I used this solution, but I think it's not an elegant one:

f[a_, b_] := Flatten[{a, #}] & /@ b;
MapThread[f, {l1, l2}] // Flatten[#, 1] &

Some clue?
Maybe with Outer or Inner?
Thanks in advance!

  • Prev by Date: Re: Why does the order of down values come back?
  • Next by Date: nsmet error in a simple equation which I can solve by hand
  • Previous by thread: Run external programs in parallel on OSX
  • Next by thread: Re: List Manipulation