Re: [Numpy-discussion] Array slices and number of dimensions

2010-09-01 Thread Anne Archibald
On 1 September 2010 17:54, Thomas Robitaille wrote: > Hi, > > I'm trying to extract sub-sections of a multidimensional array while keeping > the number of dimensions the same. If I just select a specific element along > a given direction, then the number of dimensions goes down by one: > im

Re: [Numpy-discussion] Array slices and number of dimensions

2010-09-01 Thread Pauli Virtanen
Wed, 01 Sep 2010 17:54:26 -0400, Thomas Robitaille wrote: > >>> a[[0],:,:].shape > (1, 10, 10) [clip] > so I can get around the issue, but just wanted to check whether the > issue with a[[0],:,[5]] is a bug? No. The syntax does not mean what you think it means, see http://docs.scipy.org/doc/numpy

Re: [Numpy-discussion] Array slices and number of dimensions

2010-09-01 Thread Warren Weckesser
Thomas Robitaille wrote: > Hi, > > I'm trying to extract sub-sections of a multidimensional array while keeping > the number of dimensions the same. If I just select a specific element along > a given direction, then the number of dimensions goes down by one: > > > > In fact, I can get what

[Numpy-discussion] Array slices and number of dimensions

2010-09-01 Thread Thomas Robitaille
Hi, I'm trying to extract sub-sections of a multidimensional array while keeping the number of dimensions the same. If I just select a specific element along a given direction, then the number of dimensions goes down by one: >>> import numpy as np >>> a = np.zeros((10,10,10)) >>> a.shape (10, 1