Re: [Numpy-discussion] simple indexing question

2009-09-23 Thread Neal Becker
josef.p...@gmail.com wrote: > On Wed, Sep 23, 2009 at 11:12 AM, Neal Becker wrote: >> Robert Cimrman wrote: >> >>> Neal Becker wrote: I have an array: In [12]: a Out[12]: array([[0, 1, 2, 3, 4], [5, 6, 7, 8, 9]]) And a selection array: In [13]: b Out[1

Re: [Numpy-discussion] simple indexing question

2009-09-23 Thread Robert Cimrman
josef.p...@gmail.com wrote: > On Wed, Sep 23, 2009 at 11:12 AM, Neal Becker wrote: >> Robert Cimrman wrote: >> >>> Neal Becker wrote: I have an array: In [12]: a Out[12]: array([[0, 1, 2, 3, 4], [5, 6, 7, 8, 9]]) And a selection array: In [13]: b

Re: [Numpy-discussion] simple indexing question

2009-09-23 Thread josef . pktd
On Wed, Sep 23, 2009 at 11:12 AM, Neal Becker wrote: > Robert Cimrman wrote: > >> Neal Becker wrote: >>> I have an array: >>> In [12]: a >>> Out[12]: >>> array([[0, 1, 2, 3, 4], >>>        [5, 6, 7, 8, 9]]) >>> >>> And a selection array: >>> In [13]: b >>> Out[13]: array([1, 1, 1, 1, 1]) >>> >>> I

Re: [Numpy-discussion] simple indexing question

2009-09-23 Thread Neal Becker
Robert Cimrman wrote: > Neal Becker wrote: >> I have an array: >> In [12]: a >> Out[12]: >> array([[0, 1, 2, 3, 4], >>[5, 6, 7, 8, 9]]) >> >> And a selection array: >> In [13]: b >> Out[13]: array([1, 1, 1, 1, 1]) >> >> I want a 1-dimensional output, where the array b selects an element

Re: [Numpy-discussion] simple indexing question

2009-09-23 Thread Robert Cimrman
Neal Becker wrote: > I have an array: > In [12]: a > Out[12]: > array([[0, 1, 2, 3, 4], >[5, 6, 7, 8, 9]]) > > And a selection array: > In [13]: b > Out[13]: array([1, 1, 1, 1, 1]) > > I want a 1-dimensional output, where the array b selects an element from > each column of a, where if

[Numpy-discussion] simple indexing question

2009-09-23 Thread Neal Becker
I have an array: In [12]: a Out[12]: array([[0, 1, 2, 3, 4], [5, 6, 7, 8, 9]]) And a selection array: In [13]: b Out[13]: array([1, 1, 1, 1, 1]) I want a 1-dimensional output, where the array b selects an element from each column of a, where if b[i]=0 select element from 0th row of a and