Re: [Numpy-discussion] finding nonzero elements in list

2009-10-12 Thread Gökhan Sever
On Mon, Oct 12, 2009 at 9:39 AM, Gökhan Sever wrote: > > > On Mon, Oct 12, 2009 at 9:18 AM, per freem wrote: > >> hi all, >> >> i'm trying to find nonzero elements in an array, as follows: >> >> a = array([[1, 0], >> [1, 1], >> [1, 1], >> [0, 1]]) >> >> i want to find all eleme

Re: [Numpy-discussion] finding nonzero elements in list

2009-10-12 Thread Gökhan Sever
On Mon, Oct 12, 2009 at 9:18 AM, per freem wrote: > hi all, > > i'm trying to find nonzero elements in an array, as follows: > > a = array([[1, 0], > [1, 1], > [1, 1], > [0, 1]]) > > i want to find all elements that are [1,1]. i tried: nonzero(a == > [1,0]) but i cannot interpre

Re: [Numpy-discussion] finding nonzero elements in list

2009-10-12 Thread josef . pktd
On Mon, Oct 12, 2009 at 10:18 AM, per freem wrote: > hi all, > > i'm trying to find nonzero elements in an array, as follows: > > a = array([[1, 0], >       [1, 1], >       [1, 1], >       [0, 1]]) > > i want to find all elements that are [1,1]. i tried: nonzero(a == > [1,0]) but i cannot interpre

[Numpy-discussion] finding nonzero elements in list

2009-10-12 Thread per freem
hi all, i'm trying to find nonzero elements in an array, as follows: a = array([[1, 0], [1, 1], [1, 1], [0, 1]]) i want to find all elements that are [1,1]. i tried: nonzero(a == [1,0]) but i cannot interpret the output. the output i get is: (array([0, 0, 1, 2]), array([0, 1