MathGroup Archive 1998

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

Search the Archive

Re: List Manipulation



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
> 
> --
>                                  * *
>                                 *    *
>                            /\    */\*

>                           /  \   /  \ /\
Paul:

lst = Table[Random[], {7},{2}]

{{0.234175,0.759186},{0.204252,0.729903},{0.325512,0.0396457},{0.872985,
   
0.291478},{0.842928,0.970129},{0.550634,0.634746},{0.0596751,0.454021}}


Partition[lst, 1,2, Sequence]

{{0.234175,0.759186},{0.325512,0.0396457},{0.842928,0.970129},
{0.0596751, 0.454021}}

-- 
Allan Hayes
Training and Consulting
Leicester, UK
hay@haystack.demon.co.uk
http://www.haystack.demon.co.uk
voice: +44 (0)116 271 4198
fax: +44 (0)116 271 8642




  • Prev by Date: Re: ReplacePart?
  • Next by Date: Re: Left and right quotes
  • Prev by thread: Re: List Manipulation
  • Next by thread: Re: List Manipulation