Re: [Numpy-discussion] Optimizing recursive loop - updated example

2011-07-24 Thread Joon Ro
For those cases where you cannot vectorize the operation, numpy is usually does not help much. Try using Cython. You will be able to compile the part of the code and the loop will be much faster (can be more than 100 times faster). http://docs.cython.org/ -Joon On Sun, 24 Jul 2011 18:10:14

[Numpy-discussion] Warning: invalid value encountered in true_divide?

2011-03-30 Thread Joon Ro
Hi,After numpy upgrade, I started to get "Warning: invalid value encountered in true_divide," when I run a code which did now show any warning previously.What does it mean and where should I look to fix this? It does not stop my debugger so I could not identify where the message was from.Thank you,

Re: [Numpy-discussion] NaN value processing in weave.inline code

2011-01-14 Thread Joon Ro
Oops .. I guess isnan() inside the weave code just works fine. Should have tried this first. By the way, is there any speed lost doing this? Should I convert all NaN values into a integer and use it inside the weave inline c code?-Joon On Fri, 14 Jan 2011 14:03:16 -0600, Joon Ro wrote: Hi,I was

[Numpy-discussion] NaN value processing in weave.inline code

2011-01-14 Thread Joon Ro
Hi,I was wondering if it is possible to process (in if statement - check if the given value is NaN) numpy NaN value inside the weave.inline c code.testcode = '''if (test(0)) {      return_val = test(0);}'''err = weave.inline(testcode, ['test'], type_converters = converters.blit