Re: [Numpy-discussion] (Late) summary of PEP-225 discussion at Scipy

2008-10-27 Thread James Philbin
One operator which could be used is '%'. We could keep the current behaviour for ARRAY%SCALAR but have ARRAY%ARRAY as being matrix multiplication. It has the same precedence as *,/. James ___ Numpy-discussion mailing list Numpy-discussion@scipy.org

[Numpy-discussion] How to do: y[yT] = y+T

2008-10-27 Thread Nicolas ROUX
Hello, I hope this is not a silly question ;-) I have a Numpy array, and I want to process it with : if the value is lower than Threshold, then increase by Threshold I would like to translate it as: y[yTreshold] = y + Treshold To benefit from the Numpy speed. But this doesn't work, any idea

Re: [Numpy-discussion] How to do: y[yT] = y+T

2008-10-27 Thread Gabriel Gellner
On Mon, Oct 27, 2008 at 12:41:06PM +0100, Nicolas ROUX wrote: Hello, I hope this is not a silly question ;-) I have a Numpy array, and I want to process it with : if the value is lower than Threshold, then increase by Threshold I would like to translate it as: y[yTreshold] = y +

Re: [Numpy-discussion] [mailinglist] How to do: y[yT] = y+T

2008-10-27 Thread Uwe Schmitt
Nicolas ROUX schrieb: Hello, I hope this is not a silly question ;-) I have a Numpy array, and I want to process it with : if the value is lower than Threshold, then increase by Threshold I would like to translate it as: y[yTreshold] = y + Treshold Hi, your solution does not work,

Re: [Numpy-discussion] [mailinglist] How to do: y[yT] = y+T

2008-10-27 Thread Gabriel Gellner
On Mon, Oct 27, 2008 at 12:45:44PM +0100, Uwe Schmitt wrote: Nicolas ROUX schrieb: Hello, I hope this is not a silly question ;-) I have a Numpy array, and I want to process it with : if the value is lower than Threshold, then increase by Threshold I would like to translate it

Re: [Numpy-discussion] How to do: y[yT] = y+T

2008-10-27 Thread David Douard
Le Monday 27 October 2008 12:41:06 Nicolas ROUX, vous avez écrit : Hello, I hope this is not a silly question ;-) I have a Numpy array, and I want to process it with : if the value is lower than Threshold, then increase by Threshold I would like to translate it as: y[yTreshold] = y +

Re: [Numpy-discussion] How to do: y[yT] = y+T

2008-10-27 Thread Nicolas ROUX
Thanks for all of you, for this fast and good reply ;-) Nicolas. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of David Douard Sent: Monday, October 27, 2008 12:51 PM To: numpy-discussion@scipy.org Subject: Re: [Numpy-discussion] How to do: y[yT] = y+T

Re: [Numpy-discussion] (Late) summary of PEP-225 discussion at Scipy

2008-10-27 Thread David Warde-Farley
On 27-Oct-08, at 7:22 AM, James Philbin wrote: One operator which could be used is '%'. We could keep the current behaviour for ARRAY%SCALAR but have ARRAY%ARRAY as being matrix multiplication. It has the same precedence as *,/. The problem is that it would monkey with existing semantics for

Re: [Numpy-discussion] How to do: y[yT] = y+T

2008-10-27 Thread Anne Archibald
If what you are trying to do is actually ensure all data is within the range [a,b], you may be interested to know that python's % operator works on floating-point numbers: In [1]: -0.1 % 1 Out[1]: 0.90002 So if you want all samples in the range (0,1) you can just do y%=1. Anne

[Numpy-discussion] How to do : x[i,j] = y[k, j] with k = i+sj

2008-10-27 Thread Nicolas ROUX
Hi, Me again ;-) I have now a new question to ask (I hope not too silly). How to do : for j in range(yHeight): for i in range(xWidth): x[j,i] = y[k,i] with k = numpy.mod(i+sj,yHeight) With efficient numpy code, without the double for ? Thanks, Cheers, Nicolas. -Original

[Numpy-discussion] any interest in including a second-order gradient?

2008-10-27 Thread Andrew Hawryluk
We wrote a simple variation on the gradient() function to calculate the second derivatives. Would there be any interest in including a gradient2() in numpy? Andrew def gradient2(f, *varargs): Calculate the second-order gradient of an N-dimensional scalar function. Uses central

Re: [Numpy-discussion] (Late) summary of PEP-225 discussion at Scipy

2008-10-27 Thread Eric Firing
James Philbin wrote: One operator which could be used is '%'. We could keep the current behaviour for ARRAY%SCALAR but have ARRAY%ARRAY as being matrix multiplication. It has the same precedence as *,/. No, having completely unrelated meanings for the same operator symbol sounds like a

Re: [Numpy-discussion] (Late) summary of PEP-225 discussion at Scipy

2008-10-27 Thread Fernando Perez
On Mon, Oct 27, 2008 at 11:31 AM, Eric Firing [EMAIL PROTECTED] wrote: James Philbin wrote: One operator which could be used is '%'. We could keep the current behaviour for ARRAY%SCALAR but have ARRAY%ARRAY as being matrix multiplication. It has the same precedence as *,/. No, having

[Numpy-discussion] ParallelProgramming wiki page

2008-10-27 Thread Robin
Hi, I made some changes to the ParallelProgramming wiki page to outline use of the (multi)processing module as well as the threading module. I'm very much not an expert on this - just researched it for myself, so please feel free to correct/ extend/ delete as appropriate. Robin

[Numpy-discussion] problems multiplying poly1d with number from array

2008-10-27 Thread Mark Bakker
Hello list - I can multiply a poly1d instance with a number, but when I multiply with a number from an array, the order matters. That seems a bug: a = array([2]) p = poly1d([1,2]) print 2*p # Works 2 x + 4 print a[0]*p # Doesn't work, returns an array [2 4] print p*a[0] # Works 2 x + 4

Re: [Numpy-discussion] ParallelProgramming wiki page

2008-10-27 Thread Sebastien Binet
On Monday 27 October 2008 12:56:56 Robin wrote: Hi, I made some changes to the ParallelProgramming wiki page to outline use of the (multi)processing module as well as the threading module. I'm very much not an expert on this - just researched it for myself, so please feel free to correct/

Re: [Numpy-discussion] ParallelProgramming wiki page

2008-10-27 Thread Robert Kern
On Mon, Oct 27, 2008 at 15:20, Sebastien Binet [EMAIL PROTECTED] wrote: On Monday 27 October 2008 12:56:56 Robin wrote: Hi, I made some changes to the ParallelProgramming wiki page to outline use of the (multi)processing module as well as the threading module. I'm very much not an expert on

Re: [Numpy-discussion] numpy array change notifier?

2008-10-27 Thread Pierre GM
On Monday 27 October 2008 16:54:09 Erik Tollerud wrote: Is there any straightforward way of notifying on change of a numpy array that leaves the numpy arrays still efficient? Erik, may be you could try the trick presented here : http://www.scipy.org/Subclasses in the __array_wrap__ section.

Re: [Numpy-discussion] numpy array change notifier?

2008-10-27 Thread Brent Pedersen
On Mon, Oct 27, 2008 at 1:56 PM, Robert Kern [EMAIL PROTECTED] wrote: On Mon, Oct 27, 2008 at 15:54, Erik Tollerud [EMAIL PROTECTED] wrote: Is there any straightforward way of notifying on change of a numpy array that leaves the numpy arrays still efficient? Not currently, no. -- Robert

Re: [Numpy-discussion] ParallelProgramming wiki page

2008-10-27 Thread dmitrey
Did you mean this one http://www.netlib.org/scalapack/pblas_qref.html ? As for the ParallelProgramming wiki page, there are some words in section Use parallel primitives about numpy.dot still I can't understand from the section: if I get numpy from sources and compile it (via python setup.py

Re: [Numpy-discussion] ParallelProgramming wiki page

2008-10-27 Thread Robin
On Mon, Oct 27, 2008 at 9:17 PM, dmitrey [EMAIL PROTECTED] wrote: As for the ParallelProgramming wiki page, there are some words in section Use parallel primitives about numpy.dot still I can't understand from the section: if I get numpy from sources and compile it (via python setup.py build)

Re: [Numpy-discussion] numpy array change notifier?

2008-10-27 Thread Ryan May
Brent Pedersen wrote: On Mon, Oct 27, 2008 at 1:56 PM, Robert Kern [EMAIL PROTECTED] wrote: On Mon, Oct 27, 2008 at 15:54, Erik Tollerud [EMAIL PROTECTED] wrote: Is there any straightforward way of notifying on change of a numpy array that leaves the numpy arrays still efficient? Not