Re: Transpose to multiple lists
- To: mathgroup at smc.vnet.net
- Subject: [mg55794] Re: [mg55735] Transpose to multiple lists
- From: DrBob <drbob at bigfoot.com>
- Date: Wed, 6 Apr 2005 03:11:38 -0400 (EDT)
- References: <200504050720.DAA26949@smc.vnet.net>
- Reply-to: drbob at bigfoot.com
- Sender: owner-wri-mathgroup at wolfram.com
lst = {{4, 6, 3}, {6, 8, 7, 3}, {9, 4}}; f = Transpose@{Range@Length@#, #} &; f /@ lst {{{1, 4}, {2, 6}, {3, 3}}, {{1, 6}, {2, 8}, {3, 7}, {4, 3}}, {{1, 9}, {2, 4}}} Bobby On Tue, 5 Apr 2005 03:20:53 -0400 (EDT), <konstantpi at mail15.com> wrote: > First Q:Transpose to multiple lists > a={3,6,3,2} > b={9,8,7,6} > Join[Transpose[{Range[Length[a]], a}],Transpose[{Range[Length[b]], b}]] > > Out[]={{1, 3}, {2, 6}, {3, 3}, {4, 2}, {1, 9}, {2, 8}, {3, 7}, {4, 6}} > what are the concise solutions other than this dumby solution > > Second Question: transposing Range to every sublist > lst={{4,6,3},{6,8,7,3},{9,4}} > how could i obtain the output: > {{1,4},{2,6},{3,3},{1,6},{2,8},{3,7},{4,3},{1,9},{2,4}} > thanks > konstant. > > > > -- DrBob at bigfoot.com
- References:
- Transpose to multiple lists
- From: konstantpi@mail15.com
- Transpose to multiple lists