[Numpy-discussion] Indexing transposes the array?

Jonathan Taylor jonathan.taylor@utoronto...
Mon Sep 21 14:36:05 CDT 2009


Why does indexing seem to transpose this array?

In [14]: x = arange(8).reshape((2,2,2))

In [15]: x[0,:,:]
Out[15]:
array([[0, 1],
      [2, 3]])

In [16]: x[0,:,[0,1]]
Out[16]:
array([[0, 2],
      [1, 3]])

Thanks,
Jonathan.


More information about the NumPy-Discussion mailing list