[Numpy-discussion] add axis to results of reduction (mean, min, ...)

Charles R Harris charlesr.harris@gmail....
Thu Aug 6 11:58:06 CDT 2009

On Thu, Aug 6, 2009 at 9:55 AM, <josef.pktd@gmail.com> wrote:

> What's the best way of getting back the correct shape to be able to
> broadcast, mean, min,.. to the original array, that works for
> arbitrary dimension and axis?
> I thought I have seen some helper functions, but I don't find them anymore?

Adding a keyword to retain the number of dimensions has been mooted. It
shouldn't be too difficult to implement and would allow things like:

>>> scaled = a/a.max(1, reduce=0)

I could do that for 1.4 if folks are interested.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/numpy-discussion/attachments/20090806/f84909de/attachment.html 

More information about the NumPy-Discussion mailing list