Re: [Numpy-discussion] Reductions with nditer working only with the last axis

2012-10-01 Thread Sergio Pascual
Perhaps sum wasn't the best function for this example. I'm going to rework the code with other function Consider a function that operates on an array and returns a number def myfunc(data): return data.min() + 2 * data.max() The function with nditer is: def nditer_fun(data, axes): it = n

Re: [Numpy-discussion] Reductions with nditer working only with the last axis

2012-10-01 Thread Han Genuit
On Thu, Sep 27, 2012 at 6:08 PM, Sergio Pascual wrote: > Hello, I'm trying to understand how to work with nditer to do a > reduction, in my case converting a 3d array into a 2d array. > > I followed the help here > http://docs.scipy.org/doc/numpy/reference/arrays.nditer.html and > managed to creat

[Numpy-discussion] Reductions with nditer working only with the last axis

2012-09-27 Thread Sergio Pascual
Hello, I'm trying to understand how to work with nditer to do a reduction, in my case converting a 3d array into a 2d array. I followed the help here http://docs.scipy.org/doc/numpy/reference/arrays.nditer.html and managed to create a function that applies reduction over the last axis of the input