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