[Numpy-discussion] howto apply-along-axis?

Sergio Pascual sergio.pasra at gmail.com
Sun Mar 24 17:46:56 EDT 2013

This is the closer I got to do what you say


Converts a 3D to 2D, but only works in the last axis. Any improvement would
be welcomed.ç

2013/3/22 Neal Becker <ndbecker2 at gmail.com>

> I frequently find I have my 1d function that performs some reduction that
> I'd
> like to apply-along some axis of an n-d array.
> As a trivial example,
> def sum(u):
>   return np.sum (u)
> In this case the function is probably C/C++ code, but that is irrelevant (I
> think).
> Is there a reasonably efficient way to do this within numpy?
> _______________________________________________
> NumPy-Discussion mailing list
> NumPy-Discussion at scipy.org
> http://mail.scipy.org/mailman/listinfo/numpy-discussion
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20130324/aa70b66c/attachment.html>

More information about the NumPy-Discussion mailing list