<div dir="ltr"><div>This is the closer I got to do what you say<br><br><a href="http://numpy-discussion.10968.n7.nabble.com/Reductions-with-nditer-working-only-with-the-last-axis-td8157.html">http://numpy-discussion.10968.n7.nabble.com/Reductions-with-nditer-working-only-with-the-last-axis-td8157.html</a><br>

<br></div>Converts a 3D to 2D, but only works in the last axis. Any improvement would be welcomed.ç<br><br><br></div><div class="gmail_extra"><br><br><div class="gmail_quote">2013/3/22 Neal Becker <span dir="ltr"><<a href="mailto:ndbecker2@gmail.com" target="_blank">ndbecker2@gmail.com</a>></span><br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I frequently find I have my 1d function that performs some reduction that I'd<br>
like to apply-along some axis of an n-d array.<br>
<br>
As a trivial example,<br>
<br>
def sum(u):<br>
  return np.sum (u)<br>
<br>
In this case the function is probably C/C++ code, but that is irrelevant (I<br>
think).<br>
<br>
Is there a reasonably efficient way to do this within numpy?<br>
<br>
_______________________________________________<br>
NumPy-Discussion mailing list<br>
<a href="mailto:NumPy-Discussion@scipy.org">NumPy-Discussion@scipy.org</a><br>
<a href="http://mail.scipy.org/mailman/listinfo/numpy-discussion" target="_blank">http://mail.scipy.org/mailman/listinfo/numpy-discussion</a><br>
</blockquote></div><br></div>