[Numpy-discussion] indexing question

Charles R Harris charlesr.harris@gmail....
Tue Mar 30 09:46:22 CDT 2010


On Tue, Mar 30, 2010 at 8:13 AM, Tom K. <tpk@kraussfamily.org> wrote:

>
> This one bit me again, and I am trying to understand it better so I can
> anticipate when it will happen.
>
> What I want to do is get rid of singleton dimensions, and index into the
> last dimension with an array.
>
> In [1]: import numpy as np
>
> In [2]: x=np.zeros((10,1,1,1,14,1024))
>
> In [3]: x[:,0,0,0,:,[1,2,3]].shape
> Out[3]: (3, 10, 14)
>
>
Hmm... That doesn't look right.

<snip>

Chuck
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/numpy-discussion/attachments/20100330/5d3a4a5e/attachment-0001.html 


More information about the NumPy-Discussion mailing list