MathGroup Archive 2004

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

Search the Archive

Fwd: Simple list operation


 Hi,
 One way is

 p = {x, Y} // Transpose

 Yas

> On Jan 16, 2004, at 5:04 AM, Dr. Wolfgang Hintze wrote:
>
>> Given two lists
>>
>> In[10]:=
>> x = {a, b, c};
>>
>> In[11]:=
>> y = {A, B, C};
>>
>> how can I get the list of pairs
>>
>> p={{a,A},{b,B},{c,C}}?
>>
>> I have used a brute force method like
>>
>> In[9]:=
>> p = Table[ {x[[i]], y[[i]]}, {i, 1, 3}]
>>
>> Out[9]=
>> {{a, A}, {b, B}, {c, C}}
>>
>> but I'm sure there is a much more elegant way.
>> Any hint is greatly appreciated.
>>
>> Wolfgang
>>
>


  • Prev by Date: Re: Who find a better fit of this experimental data?
  • Next by Date: Re: Simple list operation
  • Previous by thread: Re: Simple list operation
  • Next by thread: Re: Simple list operation