Re: [Numpy-discussion] numpy.where

2007-07-15 Thread Robert Kern
Sebastian Haase wrote: > Which file(s) should I be looking for? numpy/core/src/multiarraymodule.c . You will need to modify the functions array_where() and PyArray_Where(). Be sure to update ma.py to match, and update numarray/functions.py to make use of the out= argument (numarray had it and we

Re: [Numpy-discussion] numpy.where

2007-07-15 Thread Sebastian Haase
On 7/15/07, Robert Kern <[EMAIL PROTECTED]> wrote: > Sebastian Haase wrote: > > On 7/14/07, Robert Kern <[EMAIL PROTECTED]> wrote: > >> Sebastian Haase wrote: > > >>> 2) Could we have another optional argument "dtype" in numpy.where()? > >>> Otherwise I would have to always write code like this: >

Re: [Numpy-discussion] numpy.where

2007-07-15 Thread Sebastian Haase
On 7/15/07, Robert Kern <[EMAIL PROTECTED]> wrote: > Sebastian Haase wrote: > > On 7/14/07, Robert Kern <[EMAIL PROTECTED]> wrote: > >> Sebastian Haase wrote: > > >>> 2) Could we have another optional argument "dtype" in numpy.where()? > >>> Otherwise I would have to always write code like this: >

Re: [Numpy-discussion] numpy.where

2007-07-15 Thread Robert Kern
Sebastian Haase wrote: > On 7/14/07, Robert Kern <[EMAIL PROTECTED]> wrote: >> Sebastian Haase wrote: >>> 2) Could we have another optional argument "dtype" in numpy.where()? >>> Otherwise I would have to always write code like this: >>> a = N.where( arr>x, 1.0, 0.0) >>> a = a.astype(N.float32) >>

Re: [Numpy-discussion] numpy.where

2007-07-15 Thread Sebastian Haase
On 7/14/07, Robert Kern <[EMAIL PROTECTED]> wrote: > Sebastian Haase wrote: > > Hi. > > Two things. > > 1) The doc-string of numpy.where() states that transpose(where(cond, > > x,y)) whould always return a 2d-array. How can this be true?? It also > > says (before) that if x,y are given where(cond,x

Re: [Numpy-discussion] numpy.where

2007-07-14 Thread Robert Kern
Sebastian Haase wrote: > Hi. > Two things. > 1) The doc-string of numpy.where() states that transpose(where(cond, > x,y)) whould always return a 2d-array. How can this be true?? It also > says (before) that if x,y are given where(cond,x,y) always returns an > array of the same shape as cond I

[Numpy-discussion] numpy.where

2007-07-14 Thread Sebastian Haase
Hi. Two things. 1) The doc-string of numpy.where() states that transpose(where(cond, x,y)) whould always return a 2d-array. How can this be true?? It also says (before) that if x,y are given where(cond,x,y) always returns an array of the same shape as cond 2) Could we have another optional ar