[Numpy-discussion] using reducing functions without eliminating dimensions?

Dan Lenski dlenski@gmail....
Fri Apr 10 01:36:08 CDT 2009


On Thu, 09 Apr 2009 01:31:33 -0500, Robert Kern wrote:

> On Thu, Apr 9, 2009 at 01:29, Anne Archibald <peridot.faceted@gmail.com>
> wrote:
> 
>> What's wrong with np.amin(a,axis=-1)[...,np.newaxis]?
> 
> It's cumbersome, particularly when you have axis=arbitrary_axis.

Quite right.  It would nice to be able to say:

np.amin(a, axiskeep=-1)
or
a.min(axiskeep=3)

... or something along those lines.

Dan



More information about the Numpy-discussion mailing list