Re: Lists
- To: mathgroup at smc.vnet.net
- Subject: [mg4013] Re: [mg3881] Lists
- From: "Richard L. Bowman" <rbowman at bridgewater.edu>
- Date: Mon, 20 May 1996 02:12:13 -0400
- Sender: owner-wri-mathgroup at wolfram.com
On Tue, 14 May 1996, Alex Bates wrote: > I have a two dimensional list (i.e. {{1, 23}, {2, 24}, {3, 25}, > {4, 26}}), and I want to remove all the first values in each pair of > numbers. For instance, for the first pair, I want it to read {23}, and > for the second, {24} instead of {2, 24}. This is another way of doing what you want: In[1]:= x = {{1, 23}, {2, 24}, {3, 25}, {4, 26}} Out[1]= {{1, 23}, {2, 24}, {3, 25}, {4, 26}} In[2]:= Transpose[{Table[x[[i,2]],{i,1,4}]}] Out[2]= {{23}, {24}, {25}, {26}} ------------------------------------------------------------------------- Dr. Richard L. Bowman Dept. of Physics e-mail: rbowman at bridgewater.edu Bridgewater College phone: 540-828-5441 Bridgewater, VA 22812 FAX: 540-828-5479 "http://www.bridgewater.edu/departments/physics/physics.html" ------------------------------------------------------------------------- ==== [MESSAGE SEPARATOR] ====