[SciPy-user] sum / average of multidimensional arrays

lorenzo bolla lbolla at gmail.com
Fri Jul 18 04:07:35 EDT 2008


You can use the "axis" keyword in numpy.sum() and numpy.mean().
L.

On Fri, Jul 18, 2008 at 7:39 AM, John [H2O] <washakie at gmail.com> wrote:

>
> Hello, I have an array, with 20 days worth of global model output at three
> layers (180,360,3) so my array is actually shape (180,360,3,20).
>
> I'm trying to produce a few new arrays:
>
> 1) The sum of the tohree layers for all 20 days, so shape (180,360,20)
>
> and
>
> 2) The sum of all 20 days AND all three layers, so shape (180,360)
>
> and
>
> 3) The average of all 20 days at each layer, so shape (180,360,3)
>
> Anyone mind providing some insight? Thanks!
> --
> View this message in context:
> http://www.nabble.com/sum---average-of-multidimensional-arrays-tp18523480p18523480.html
> Sent from the Scipy-User mailing list archive at Nabble.com.
>
> _______________________________________________
> SciPy-user mailing list
> SciPy-user at scipy.org
> http://projects.scipy.org/mailman/listinfo/scipy-user
>



-- 
"Whereof one cannot speak, thereof one must be silent." -- Ludwig
Wittgenstein
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.scipy.org/pipermail/scipy-user/attachments/20080718/b5513a0c/attachment.html>


More information about the SciPy-User mailing list