Re: lists
- To: mathgroup@smc.vnet.net
- Subject: [mg10548] Re: lists
- From: Allan Hayes <hay@haystack.demon.co.uk>
- Date: Tue, 20 Jan 1998 16:53:52 -0500
- References: <69nc3r$8bh@smc.vnet.net>
Paul.Hanson@colorado.edu wrote: > > Hola! > So, if you have a couple of lists: > {{1},{2},{3},{4}....{n}} > and > {{1a},....{na}} > and I want to combine them such that, > {{1},{1a},{2},{2a}....{n},{na}} > > How do I get there? Thanks in advance for the help. > > Paul Hanson > > -- > * * > * * > /\ */\* > / \ / \ /\ Paul: l1 = {{1},{2},{3},{4}}; l2 = {{1a},{2a},{3a},{4a}}; Flatten[Transpose[{l1,l2}],1] {{1},{a},{2},{2 a},{3},{3 a},{4},{4 a}} -- Allan Hayes Training and Consulting Leicester, UK hay@haystack.demon.co.uk http://www.haystack.demon.co.uk voice: +44 (0)116 271 4198 fax: +44 (0)116 271 8642