[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, 10, 10)

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: snip In fact, I can get what I

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

2010-09-01 Thread Anne Archibald
On 1 September 2010 17:54, Thomas Robitaille thomas.robitai...@gmail.com 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