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

2009-04-10 Thread Dan Lenski
On Thu, 09 Apr 2009 01:31:33 -0500, Robert Kern wrote: On Thu, Apr 9, 2009 at 01:29, Anne Archibald peridot.face...@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

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

2009-04-09 Thread Charles R Harris
On Tue, Apr 7, 2009 at 12:44 PM, Dan Lenski dlen...@gmail.com wrote: Hi all, I often want to use some kind of dimension-reducing function (like min(), max(), sum(), mean()) on an array without actually removing the last dimension, so that I can then do operations broadcasting the reduced

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

2009-04-09 Thread Anne Archibald
2009/4/9 Charles R Harris charlesr.har...@gmail.com: On Tue, Apr 7, 2009 at 12:44 PM, Dan Lenski dlen...@gmail.com wrote: Hi all, I often want to use some kind of dimension-reducing function (like min(), max(), sum(), mean()) on an array without actually removing the last dimension, so

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

2009-04-09 Thread Robert Kern
On Thu, Apr 9, 2009 at 01:29, Anne Archibald peridot.face...@gmail.com wrote: What's wrong with np.amin(a,axis=-1)[...,np.newaxis]? It's cumbersome, particularly when you have axis=arbitrary_axis. -- Robert Kern I have come to believe that the whole world is an enigma, a harmless enigma that

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

2009-04-07 Thread Dan Lenski
Hi all, I often want to use some kind of dimension-reducing function (like min(), max(), sum(), mean()) on an array without actually removing the last dimension, so that I can then do operations broadcasting the reduced array back to the size of the full array. Full example: table.shape