[SciPy-user] mean of arrays...

Matthieu Brucher matthieu.brucher@gmail....
Thu Sep 6 07:40:39 CDT 2007


If the mean must be done on the last dimension, add axis=-1, it should work.

Matthieu

2007/9/6, fred <fredmfp@gmail.com>:
>
> Gael Varoquaux a écrit :
> > On Thu, Sep 06, 2007 at 12:07:21PM +0200, fred wrote:
> >
> >> I want to compute the element wise mean of 2D or 3D arrays (~100).
> >>
> >
> > Stack all these n-arrays along an n+1 dimension, and use the numpy.mean
> > function, specifying the axis as n+1.
> >
> I can get it working by hand, if dimension is fixed, no problem.
> But how can I do this for a n+1 dimension array ?:
> - create the array;
> - fill the array.
>
> I have one solution: test if my arrays are 2D or 3D.
> If this is the only one solution, I get it,
> but I would like to have a solution for whatever dimension
> my arrays have.
>
> TIA.
>
>
> --
> http://scipy.org/FredericPetit
>
> _______________________________________________
> SciPy-user mailing list
> SciPy-user@scipy.org
> http://projects.scipy.org/mailman/listinfo/scipy-user
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://projects.scipy.org/pipermail/scipy-user/attachments/20070906/6426e2ec/attachment.html 


More information about the SciPy-user mailing list