[Numpy-discussion] is it a bug?

Jonathan Taylor jonathan.taylor at utoronto.ca
Wed Mar 11 22:51:07 EDT 2009


You lost me on
> x = np.arange(30)
> x.shape = (2,3,5)

For me I get:
In [2]: x = np.arange(30)

In [3]: x.shape
Out[3]: (30,)

which is what I would expect.   Perhaps I missed something?

Jon.

On Wed, Mar 11, 2009 at 8:55 PM, shuwj5460 at 163.com <shuwj5460 at 163.com> wrote:
> Hi,
>
> import numpy as np
> x = np.arange(30)
> x.shape = (2,3,5)
>
> idx = np.array([0,1])
> e = x[0,idx,:]
> print e.shape
> #----> return (2,5). ok.
>
> idx = np.array([0,1])
> e = x[0,:,idx]
> print e.shape
>
> #-----> return (2,3). I think the right answer should be (3,2). Is
> #       it a bug here? my numpy version is 1.2.1.
>
>
> Regards
>
> David
> --
>  <>
>
>
> _______________________________________________
> Numpy-discussion mailing list
> Numpy-discussion at scipy.org
> http://mail.scipy.org/mailman/listinfo/numpy-discussion
>



More information about the NumPy-Discussion mailing list