Re: [Numpy-discussion] indexing with arrays of indexes and +=

2006-10-25 Thread David Huard
[snip]Vincent, I may be wrong, but it looks like you could use a weighted histogramdd (see other thread where I sent a patch to do so).You run it once to find the number of sample in each bin, then again with weights=value, normed=False to find the total weight in each bin, then you can divide each

Re: [Numpy-discussion] indexing with arrays of indexes and +=

2006-10-25 Thread Vincent Schut
David Huard wrote: > 2006/10/24, Vincent Schut <[EMAIL PROTECTED] > >: > > It is clear to me that the numpy += operator in combination with > the use > of arrays of indexes, as is explained in the Tentative Numpy Tutorial > ( > > http://www.scipy.org/

Re: [Numpy-discussion] indexing with arrays of indexes and +=

2006-10-24 Thread David Huard
2006/10/24, Vincent Schut <[EMAIL PROTECTED]>: It is clear to me that the numpy += operator in combination with the useof arrays of indexes, as is explained in the Tentative Numpy Tutorial( http://www.scipy.org/Tentative_NumPy_Tutorial#head-3f4d28139e045a442f78c5218c379af64c2c8c9e),the limitation b

[Numpy-discussion] indexing with arrays of indexes and +=

2006-10-24 Thread Vincent Schut
It is clear to me that the numpy += operator in combination with the use of arrays of indexes, as is explained in the Tentative Numpy Tutorial (http://www.scipy.org/Tentative_NumPy_Tutorial#head-3f4d28139e045a442f78c5218c379af64c2c8c9e), the limitation being that indexes that appear more than 1

[Numpy-discussion] indexing

2006-10-19 Thread Alan G Isaac
John J. worked up short set of NumPy Indexing Examples that I think supplements what is at http://www.scipy.org/Tentative_NumPy_Tutorial#head-864862d3f2bb4c32f04260fac61eb4ef34788c4c> and http://www.scipy.org/Tentative_NumPy_Tutorial#head-0dffc419afa7d77d51062d40d2d84143db8216c2> so I made a coup

Re: [Numpy-discussion] indexing bug in numpy r2694

2006-06-28 Thread Keith Goodman
On 6/28/06, Travis Oliphant <[EMAIL PROTECTED]> wrote: > This should be better behaved now in SVN. Thanks for the reports. I'm impressed by how quickly features are added and bugs are fixed. And by how quick it is to install a new version of numpy. Thank you. Using Tomcat but need to do more? N

Re: [Numpy-discussion] indexing bug in numpy r2694

2006-06-28 Thread Keith Goodman
On 6/28/06, Travis Oliphant <[EMAIL PROTECTED]> wrote: > Keith Goodman wrote: > > >On 6/28/06, Pau Gargallo <[EMAIL PROTECTED]> wrote: > > > > > >>i don't know why 'where' is returning matrices. > >>if you use: > >> > >> > >> > >idx = where(y.A > 0.5)[0] > > > > > >>everything will work

Re: [Numpy-discussion] indexing bug in numpy r2694

2006-06-28 Thread Travis Oliphant
Keith Goodman wrote: >On 6/28/06, Pau Gargallo <[EMAIL PROTECTED]> wrote: > > >>i don't know why 'where' is returning matrices. >>if you use: >> >> >> >idx = where(y.A > 0.5)[0] > > >>everything will work fine (I guess) >> >> > >What about the second issue? Is this

Re: [Numpy-discussion] indexing bug in numpy r2694

2006-06-28 Thread Pau Gargallo
On 6/28/06, Keith Goodman <[EMAIL PROTECTED]> wrote: > On 6/28/06, Pau Gargallo <[EMAIL PROTECTED]> wrote: > > i don't know why 'where' is returning matrices. > > if you use: > > > > >>> idx = where(y.A > 0.5)[0] > > > > everything will work fine (I guess) > > What about the second issue? Is this e

Re: [Numpy-discussion] indexing bug in numpy r2694

2006-06-28 Thread Keith Goodman
On 6/28/06, Pau Gargallo <[EMAIL PROTECTED]> wrote: > i don't know why 'where' is returning matrices. > if you use: > > >>> idx = where(y.A > 0.5)[0] > > everything will work fine (I guess) What about the second issue? Is this expected behavior? >> idx array([0, 1, 2]) >> y matrix([[ 0.63731308

Re: [Numpy-discussion] indexing bug in numpy r2694

2006-06-28 Thread Pau Gargallo
i don't know why 'where' is returning matrices. if you use: >>> idx = where(y.A > 0.5)[0] everything will work fine (I guess) pau On 6/28/06, Keith Goodman <[EMAIL PROTECTED]> wrote: > >> x = asmatrix(rand(3,2)) > > >> y = asmatrix(rand(3,1)) > > >> y > > matrix([[ 0.77952062], >[ 0.97

[Numpy-discussion] indexing bug in numpy r2694

2006-06-28 Thread Keith Goodman
>> x = asmatrix(rand(3,2)) >> y = asmatrix(rand(3,1)) >> y matrix([[ 0.77952062], [ 0.97110465], [ 0.77450218]]) >> idx = where(y > 0.5)[0] >> idx matrix([[0, 1, 2]]) >> x[idx,:] matrix([[ 0.24837887, 0.52988253], [ 0.28661085, 0.43053076], [ 0.05360893, 0.2266