Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2005
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2005

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

Search the Archive

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


  • Prev by Date: Re: Recommendations for a programming book?
  • Next by Date: Re: How do I remove operator status?
  • Previous by thread: Transpose to multiple lists
  • Next by thread: Re: Transpose to multiple lists