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

2009-04-09 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 > 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

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

2009-04-08 Thread Robert Kern
On Thu, Apr 9, 2009 at 01:29, Anne Archibald 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 is made terrible by our

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

2009-04-08 Thread Anne Archibald
2009/4/9 Charles R Harris : > > > On Tue, Apr 7, 2009 at 12:44 PM, Dan Lenski 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

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

2009-04-08 Thread Charles R Harris
On Tue, Apr 7, 2009 at 12:44 PM, Dan Lenski 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 > array back to

[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