Re: [Numpy-discussion] Compound conditional indexing

2009-09-30 Thread Gökhan Sever
On Wed, Sep 30, 2009 at 2:45 PM, Robert Kern wrote: > On Wed, Sep 30, 2009 at 14:40, Gökhan Sever wrote: > > Thanks this works. > > > > My second question how to access a second array using this condition? > > > > I am trying slice another array using a compound condition on the > reference > >

Re: [Numpy-discussion] Compound conditional indexing

2009-09-30 Thread Robert Kern
On Wed, Sep 30, 2009 at 14:40, Gökhan Sever wrote: > Thanks this works. > > My second question how to access a second array using this condition? > > I am trying slice another array using a compound condition on the reference > array. > > say: > > a = 1,2,3,4,5, > b = 20,30,40,50,60 > > I want to

Re: [Numpy-discussion] Compound conditional indexing

2009-09-30 Thread Gökhan Sever
Thanks this works. My second question how to access a second array using this condition? I am trying slice another array using a compound condition on the reference array. say: a = 1,2,3,4,5, b = 20,30,40,50,60 I want to get elements of a only when a = 3,4. I know I need indices but how ? O

Re: [Numpy-discussion] Compound conditional indexing

2009-09-30 Thread Christopher Barker
Gökhan Sever wrote: > How to conditionally index an array as shown below : > > a = arange(10) > a[5 > to get > array([6,7]) In [56]: a[(5http://mail.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] Compound conditional indexing

2009-09-30 Thread Joe Kington
There may be a more elegant way, but: In [2]: a = np.arange(10) In [3]: a[(a>5) & (a<8)] Out[3]: array([6, 7]) On Wed, Sep 30, 2009 at 1:27 PM, Gökhan Sever wrote: > Hello, > > How to conditionally index an array as shown below : > > a = arange(10) > a[5 > to get > array([6,7]) > > I can't do

[Numpy-discussion] Compound conditional indexing

2009-09-30 Thread Gökhan Sever
Hello, How to conditionally index an array as shown below : a = arange(10) a[5___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion