MathGroup Archive 2007

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

Search the Archive

Re: List manipulation

  • To: mathgroup at
  • Subject: [mg73284] Re: List manipulation
  • From: Jens-Peer Kuska <kuska at>
  • Date: Fri, 9 Feb 2007 02:29:54 -0500 (EST)
  • Organization: Uni Leipzig
  • References: <eqep4g$5dk$>
  • Reply-to: kuska at


liste = {{a1, a2, a3}, {b1, b2, b3}, {c1, c2, c3}};

Append[#, e] & /@ liste


Join[#, {e}] & /@ liste

or just apply f[]

f[Append[#, e]] & /@ liste

and if you like MapThread[]

MapThread[f[Append[##]] &, {liste, Table[e, {Length[liste]}]}]


sepp wrote:
> hello,
> I would like to combine list elements in the following way:
> I have a list with
> liste={{a1,a2,a3},{b1,b2,b3},{c1,c2,c3},.....}
> and a single element {e}
> I would to add the element {e} to each sublist to get something like
> liste_new={ {a1,a2,a3,e},{b1,b2,b3,e},{c1,c2,c3,e},.....}
> so that finally I can apply a function f on the list
> liste_manipulated={f[ {a1,a2,a3,e}],f[{b1,b2,b3,e}],f[{c1,c2,c3,e}],.....}
> I had a look at thread, mapthread, inner, outer, but nothing really
> seems to fit...
> thank you in advance for useful comments!

  • Prev by Date: Re: List manipulation
  • Next by Date: Re: List manipulation
  • Previous by thread: Re: List manipulation
  • Next by thread: Re: List manipulation