MathGroup Archive 2005

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

Search the Archive

Re: Transpose to multiple lists


Seems convenient to use MapIndexed.
Let me first reply to the second question
because the first question is just
a particular case of the second question:

In[1]:= lst = {{4,6,3},{6,8,7,3},{9,4}};

In[2]:= MapIndexed[{First[#2],#1}&,#]& /@ lst // Flatten[#,1]&

Out[2]= {{1,4},{2,6},{3,3},{1,6},{2,8},{3,7},{4,3},{1,9},{2,4}}


In[3]:= a = {3,6,3,2}; b = {9,8,7,6};

In[4]:= MapIndexed[{First[#2],#1}&,#]& /@ {a,b} // Flatten[#,1]&

Out[4]= {{1,3},{2,6},{3,3},{4,2},{1,9},{2,8},{3,7},{4,6}}


hth

Valeri


  • Prev by Date: Re: MultipleListPlot Prolem
  • Next by Date: Re: Need to be able to diff 2 pieces of text.
  • Previous by thread: Re: Transpose to multiple lists
  • Next by thread: Re: Transpose to multiple lists