Re: List Manipulation
- To: mathgroup@smc.vnet.net
- Subject: [mg10553] Re: List Manipulation
- From: dreissNOSPAM@nospam.earthlink.net (David Reiss)
- Date: Tue, 20 Jan 1998 16:53:57 -0500
- Organization: EarthLink Network, Inc.
- References: <69nbfq$89h@smc.vnet.net>
In article <69nbfq$89h@smc.vnet.net>, Paul.Hanson@colorado.edu wrote: > Hola! > Hope you're all doing well. If I have a list of n lists, and want to > get rid of all the even ones how would I go about doing this? That > is, {{n1},{n2},.....{2n}} converted to {{n1},{n3}...{2n-1}}. I tried > using the various procedures in Wolfram's book, but nothing seems to > work (ie, Delete, Take, etc.). Thanks for the help. > > Paul Hanson > > -- > * * > * * > /\ */\* > / \ / \ /\ Here is an example of a solution built up in stages In[1]:= temp={{n1},{n2},{n3},{n4}} Out[1]= {{n1},{n2},{n3},{n4}} In[2]:= Partition[temp,2] Out[2]= {{{n1},{n2}},{{n3},{n4}}} In[3]:= Transpose[Partition[temp,2]] Out[3]= {{{n1},{n3}},{{n2},{n4}}} In[4]:= Transpose[Partition[temp,2]][[1]] Out[4]= {{n1},{n3}} -- David Reiss dreissNOSPAM@nospam.earthlink.net http://home.earthlink.net/~dreiss To send personal email, remove the words "nospam" and "NOSPAM" from the email address