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,y) always

[Numpy-discussion] optimization of arr**-2

2007-07-15 Thread Sebastian Haase
Hi, I compared for a 256x256 float32 normal-noise (x0=100,sigma=1) array the times to do 1./ (a*a) vs. a**-2 U.timeIt('1./(a*a)', 1000) (0.00090877471871, 0.00939644563778, 0.00120674694689, 0.00068554628) U.timeIt('a**-2', 1000) (0.00876591857354, 0.0263829620803, 0.00952076311375,

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( arrx, 1.0, 0.0) a = a.astype(N.float32) a = N.where(arr x,

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: a = N.where( arrx,

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: a = N.where( arrx,

Re: [Numpy-discussion] optimization of arr**-2

2007-07-15 Thread Timothy Hochberg
On 7/15/07, Sebastian Haase [EMAIL PROTECTED] wrote: Hi, I compared for a 256x256 float32 normal-noise (x0=100,sigma=1) array the times to do 1./ (a*a) vs. a**-2 U.timeIt('1./(a*a)', 1000) (0.00090877471871, 0.00939644563778, 0.00120674694689, 0.00068554628) U.timeIt('a**-2', 1000)

[Numpy-discussion] ANN: SciPy 2007 Conference Updates

2007-07-15 Thread Travis Vaught
Greetings, We're excited to have *Ivan Krstić*, the director of security architecture for the One Laptop Per Child project as our Keynote Speaker this year. The planning for the SciPy 2007 Conference is moving along. Please see below for some important updates. Schedule Available