Re: array subset could be improved? -repost ;)

2005-10-17 Thread Jim O'D
With the new numeric, you'll be able to do: negatives = a[a0] Cheers, f Ooh, that's nice. Jim -- http://mail.python.org/mailman/listinfo/python-list

array subset could be improved? -repost ;)

2005-10-14 Thread Jim O'D
Hi all I have an array a=array([2,3,-1]). I want to extract an array with all the elements of a that are less than 0. Method 1. new = array([i for i in a if i 0]) Method 2. new = a[nonzero(a0)] I'm using Numeric arrays but can't seem to find a function that does this. Am I missing a more

Re: array subset could be improved? -repost ;)

2005-10-14 Thread jon
Jim O'D wrote: Hi all I have an array a=array([2,3,-1]). I want to extract an array with all the elements of a that are less than 0. Method 1. new = array([i for i in a if i 0]) Method 2. new = a[nonzero(a0)] I'm using Numeric arrays but can't seem to find a function that does this.

Re: array subset could be improved? -repost ;)

2005-10-14 Thread jon
Jim O'D wrote: Hi all I have an array a=array([2,3,-1]). I want to extract an array with all the elements of a that are less than 0. Method 1. new = array([i for i in a if i 0]) Method 2. new = a[nonzero(a0)] I'm using Numeric arrays but can't seem to find a function that does this.

Re: array subset could be improved? -repost ;)

2005-10-14 Thread Fernando Perez
Jim O'D wrote: Hi all I have an array a=array([2,3,-1]). I want to extract an array with all the elements of a that are less than 0. Numeric is currently changing into the new scipy core. If you are willing to play with beta code, get it here: http://numeric.scipy.org if not, wait a