Re: [Numpy-discussion] Need help for implementing a fa st clip in numpy (was slow clip)

2007-01-11 Thread Francesc Altet
A Dimecres 10 Gener 2007 22:49, Stefan van der Walt escrigué: On Wed, Jan 10, 2007 at 08:28:14PM +0100, Francesc Altet wrote: El dt 09 de 01 del 2007 a les 23:19 +0900, en/na David Cournapeau va escriure: time (putmask)-- 1.38 time (where)-- 2.713 time (numexpr where)-- 1.291 time

Re: [Numpy-discussion] Docstring standards for NumPy and SciPy

2007-01-11 Thread Jens Jørgen Mortensen
On Thu, 2007-01-11 at 07:08 -0700, Steven H. Rogers wrote: I'd prefer reStructuredText. I don't find the markup particularly noisy and it quickly fades into the background. I found some notes on the docutils page (about using reStructuredText in docstring):

Re: [Numpy-discussion] Need help for implementing a fast clip in numpy (was slow clip)

2007-01-11 Thread David Cournapeau
David Cournapeau wrote: Francesc Altet wrote: A Dimecres 10 Gener 2007 22:49, Stefan van der Walt escrigué: On Wed, Jan 10, 2007 at 08:28:14PM +0100, Francesc Altet wrote: El dt 09 de 01 del 2007 a les 23:19 +0900, en/na David Cournapeau va escriure: time (putmask)-- 1.38 time (where)--

[Numpy-discussion] random permutation

2007-01-11 Thread Keith Goodman
Why is the first element of the permutation always the same? Am I using random.permutation in the right way? x matrix([[0], [1], [2], [3]]) M.random.permutation(x) array([[0], [1], [1], [0]]) M.random.permutation(x) array([[0], [1],

[Numpy-discussion] Warning messages after upgrading to 1.0.1

2007-01-11 Thread Keith Goodman
I get lots of warning messages after upgrading from 1.0rc1 to 1.0.1: Warning: divide by zero encountered in divide Warning: invalid value encountered in log Warning: invalid value encountered in subtract Warning: invalid value encountered in multiply What's a good way to turn off the warnings?

Re: [Numpy-discussion] Fwd: Advanced selection, duplicate indices, and augmented assignment

2007-01-11 Thread Sean Lynch
Timothy Hochberg wrote: Sean, I'm pretty sure that at one point I had a way to do exactly what you are doing, however it's been a while and I don't know where that code wandered off to. I will think about it now that I'm done doing silly stuff and see if I can recall what the trick was.

Re: [Numpy-discussion] No test file found

2007-01-11 Thread Stefan van der Walt
On Thu, Jan 11, 2007 at 03:18:19PM -0800, Keith Goodman wrote: I see a lot of 'No test file found' warnings when running numpy.test(). What does that mean? It means your verbosity is set too high. You'll find that N.test(0,0) complains much less (although, realistically, you'd probably want to

Re: [Numpy-discussion] No test file found

2007-01-11 Thread Keith Goodman
On 1/11/07, Stefan van der Walt [EMAIL PROTECTED] wrote: On Thu, Jan 11, 2007 at 03:18:19PM -0800, Keith Goodman wrote: I see a lot of 'No test file found' warnings when running numpy.test(). What does that mean? It means your verbosity is set too high. You'll find that N.test(0,0)

Re: [Numpy-discussion] No test file found

2007-01-11 Thread Keith Goodman
On 1/11/07, Robert Kern [EMAIL PROTECTED] wrote: Keith Goodman wrote: I see a lot of 'No test file found' warnings when running numpy.test(). What does that mean? The test collector tries to find a test module for every actual module. So numpy/dual.py would correspond to

Re: [Numpy-discussion] How do I test if an array contains NaN ?

2007-01-11 Thread belinda thom
It's probably worth mentioning that IPython has (thanks to a user contributed implementation) search capabilities besides tab completion (which requires you to at least know the start of the string you want): In [3]: N.*nan*? N.isnan N.nan N.nan_to_num N.nanargmax N.nanargmin N.nanmax

Re: [Numpy-discussion] Latest Array-Interface PEP

2007-01-11 Thread Torgil Svensson
On 1/11/07, Charles R Harris [EMAIL PROTECTED] wrote: On 1/11/07, Torgil Svensson [EMAIL PROTECTED] wrote: Sure. I'm not objecting the memory model, what I mean is that data access between modules has a wider scope than just a memory model. Maybe i'm completely out-of-scope here, I thought

Re: [Numpy-discussion] Need help for implementing a fast clip in numpy (was slow clip)

2007-01-11 Thread David Cournapeau
Christopher Barker wrote: autogen works well enough for me; I didn't know about autogen -- that may be all we need. numpy has code which already does something similar to autogen: you declare a function, and some template with a generic name, and the code generator replaces the generic

Re: [Numpy-discussion] Need help for implementing a fast clip in numpy (was slow clip)

2007-01-11 Thread David Cournapeau
Timothy Hochberg wrote: On 1/11/07, *Christopher Barker* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: [CHOP] I'd still like to know if anyone knows how to efficiently loop through all the elements of a non-contiguous array in C. First, it's not that important if the

Re: [Numpy-discussion] Need help for implementing a fast clip in numpy (was slow clip)

2007-01-11 Thread Charles R Harris
On 1/11/07, David Cournapeau [EMAIL PROTECTED] wrote: Timothy Hochberg wrote: On 1/11/07, *Christopher Barker* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: [CHOP] I'd still like to know if anyone knows how to efficiently loop through all the elements of a non-contiguous

Re: [Numpy-discussion] Need help for implementing a fast clip in numpy (was slow clip)

2007-01-11 Thread Travis Oliphant
Timothy Hochberg wrote: On 1/11/07, *Christopher Barker* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: [CHOP] I'd still like to know if anyone knows how to efficiently loop through all the elements of a non-contiguous array in C. First, it's not that important if the

Re: [Numpy-discussion] Need help for implementing a fast clip in numpy (was slow clip)

2007-01-11 Thread David Cournapeau
Charles R Harris wrote: On 1/11/07, *David Cournapeau* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: Timothy Hochberg wrote: On 1/11/07, *Christopher Barker* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED]

Re: [Numpy-discussion] Need help for implementing a fast clip in numpy (was slow clip)

2007-01-11 Thread David Cournapeau
Travis Oliphant wrote: This is one thing I've exposed (and made use of in more than one place) with NumPy. In Numeric, the magic was in a few lines of the ufuncobject file). Now, it is exposed in the concept of an array iterator. Anybody can take advantage of it as it there is a C-API

Re: [Numpy-discussion] Need help for implementing a fast clip in numpy (was slow clip)

2007-01-11 Thread Charles R Harris
On 1/11/07, David Cournapeau [EMAIL PROTECTED] wrote: Travis Oliphant wrote: This is one thing I've exposed (and made use of in more than one place) with NumPy. In Numeric, the magic was in a few lines of the ufuncobject file). Now, it is exposed in the concept of an array iterator.

Re: [Numpy-discussion] Latest Array-Interface PEP

2007-01-11 Thread Gael Varoquaux
On Fri, Jan 12, 2007 at 12:44:15AM -0700, Charles R Harris wrote: Trees are nice, but they are not efficient for array type data. Traversing a tree usually requires some sort of stack (recursion), and a tree is not well structured for addressing data using indices. They just aren't