Re: Threading 'Append'
- To: mathgroup at smc.vnet.net
- Subject: [mg62829] Re: Threading 'Append'
- From: Bhuvanesh <lalu_bhatt at yahoo.com>
- Date: Tue, 6 Dec 2005 00:04:18 -0500 (EST)
- Sender: owner-wri-mathgroup at wolfram.com
Thread doesn't hold its arguments, and Append gives:
In[1]:= Append[{{1,2},{3,4},{5,6}},{a,b,c}]
Out[1]= {{1, 2}, {3, 4}, {5, 6}, {a, b, c}}
One way to do what you want is:
In[2]:= list1 = {{1,2},{3,4},{5,6}};
In[3]:= list2 = {a,b,c};
In[4]:= Transpose[Append[Transpose[list1],list2]]
Out[4]= {{1, 2, a}, {3, 4, b}, {5, 6, c}}
Bhuvanesh,
Wolfram Research.