MathGroup Archive 2007

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

Search the Archive

Re: split again

  • To: mathgroup at
  • Subject: [mg73671] Re: [mg73622] split again
  • From: Bob Hanlon <hanlonr at>
  • Date: Sat, 24 Feb 2007 02:18:13 -0500 (EST)
  • Reply-to: hanlonr at

Your zSplit is missing a & and even then would never result in lists longer than one whose elements are all less than or equal to 0.7

Using a different zSplit


zSplit=Split[z,#1<=0.7 === #2<=0.7&];

With this Split, lists longer than one can only contain elements less than or equal to 0.7 so it is unnecessary to test the elements' values.



Creating mixed lists

zSplit=Split[z,#1<=0.7 && #2<=0.7||#1>0.7 && #2>0.7&];



Bob Hanlon

---- Arkadiusz.Majka at wrote: 
> Hi,
> Thank you very much for your help in my provious post. Now, consider
> please a list
> z=Table[Random[],{1000}];
> zSplit=Split[z,#1<=0.7 === #2>=0.7];           (bulit thanks to your
> help)
> I want to pick the first sublist of zSplit that consists of elements
> <= 0.7 and whose length is greater than a certain number (say 5). I
> think that a good candidate would be using Cases and variations of _ ,
> but I don't know how.
> What I want to do (and what my both posts are about) is to find the
> first sublist of z with all elements less than A and the length of
> this sublist must be greater than B. Maybe there exists better
> solution than to Split z in advance since what I need to do in my next
> step is to find ONLY the FIRST sublist of splitted z.
> Thanks again,
> Arek

  • Prev by Date: Re: split again
  • Next by Date: Re: Fuction definition
  • Previous by thread: Re: split again
  • Next by thread: Re: split again