Re: [Numpy-discussion] Numpy performance vs Matlab.

2009-01-09 Thread Nicolas ROUX
Thanks ! -1- The code style is good and the performance vs matlab is good. With 400x400: Matlab = 1.56 sec (with nested "for" loop, so no optimization) Numpy = 0.99 sec (with broadcasting) -2- Now with the code below I have strange result. With w=h=400: - Using "slice"=> 0.99 se

Re: [Numpy-discussion] Numpy performance vs Matlab.

2009-01-09 Thread Nicolas ROUX
Sorry my previous mail was probalby not clear. This mail was following the tread we had before, so with some discussion legacy. I simplified the code to focus only on "what I" need, rather to bother you with the full code. I wrote below a code closer to what I need, where you will agree that vect

Re: [Numpy-discussion] Numpy performance vs Matlab.

2009-01-09 Thread Nicolas ROUX
Hi ! Thanks a lot for your fast/detailed reply. A very good point for Numpy ;-) I spent all my time trying to prepare my testcase to better share with you, that's why I didn't reply fast. I understand the weakness of the missing JITcompiler in Python vs Matlab, that's why I invistigated numpy ve

[Numpy-discussion] Numpy performance vs Matlab.

2009-01-07 Thread Nicolas ROUX
Hi, I need help ;-) I have here a testcase which works much faster in Matlab than Numpy. The following code takes less than 0.9sec in Matlab, but 21sec in Python. Numpy is 24 times slower than Matlab ! The big trouble I have is a large team of people within my company is ready to replace Matlab

Re: [Numpy-discussion] Getting indices from numpy array withcondition

2008-11-18 Thread Nicolas ROUX
Numpy-discussion] Getting indices from numpy array withcondition A Tuesday 18 November 2008, Nicolas ROUX escrigué: > Hi, > > Maybe this is not so clever, but I can't find it in the doc. > I need to get all indices/index of all occurrences of a value in a > numpy array > > > As e

Re: [Numpy-discussion] Missing numpy.i

2008-11-18 Thread Nicolas ROUX
: Thursday, October 16, 2008 3:20 PM To: Discussion of Numerical Python Subject: Re: [Numpy-discussion] Missing numpy.i 2008/10/16 Nicolas ROUX <[EMAIL PROTECTED]>: > Thanks for your reply ;-) > > In fact, I was talking about the 1.20 release installer, which is not > including th

[Numpy-discussion] Getting indices from numpy array with condition

2008-11-18 Thread Nicolas ROUX
Hi, Maybe this is not so clever, but I can't find it in the doc. I need to get all indices/index of all occurrences of a value in a numpy array As example: a = numpy.array([1,2,3],[4,5,6],[7,8,9]) I need to get the indice/index of all array elements where a[a>3] Any fast/easy way to write this

[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 Me

Re: [Numpy-discussion] How to do: y[y

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[y Hello, > >

[Numpy-discussion] How to do: y[y

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[yhttp://projects.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] Missing numpy.i

2008-10-16 Thread Nicolas ROUX
automatically ? Cheers, Nicolas. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Stefan van der Walt Sent: Thursday, October 16, 2008 3:06 PM To: Discussion of Numerical Python Subject: Re: [Numpy-discussion] Missing numpy.i 2008/10/16 Nicolas ROUX <[EM

Re: [Numpy-discussion] Missing numpy.i

2008-10-16 Thread Nicolas ROUX
Hello, Under windows, using the latest numpy 1.20 and Swig release, I can't find anymore the numpy.i file. I used to find it in numpy/doc/ in the release 1.04. I tried to look some info the web without any success. Thanks for you help, Cheers, Nicolas. ___