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
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
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
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