Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2007
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2007

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

Search the Archive

Re: Selecting Sub-lists After Split

  • To: mathgroup at smc.vnet.net
  • Subject: [mg77447] Re: Selecting Sub-lists After Split
  • From: Szabolcs <szhorvat at gmail.com>
  • Date: Sat, 9 Jun 2007 05:28:13 -0400 (EDT)
  • Organization: University of Bergen
  • References: <f4b89h$3ls$1@smc.vnet.net>

Gregory Lypny wrote:
> Hello everyone,
> 
> Suppose I have a list of real number called myList.  I split it into  
> sub-lists of positive and negative numbers called myNewList by doing  
> this (there may be a more elegant way):
> 
> myNewList = Split[myList, #1 #2 > 0 &]
> 
> Now, how can I select all of the sub-lists of negative numbers from  
> myNewList?
> 
> Any tips would be most appreciated.
> 
> Regards,
> 
> 	Gregory 
> 

Select[myNewList, Negative@First[#]&]

Szabolcs


  • Prev by Date: Re: display change in version 6
  • Next by Date: NIntegrate with change of variables
  • Previous by thread: Re: Selecting Sub-lists After Split
  • Next by thread: Re: Selecting Sub-lists After Split