[Numpy-discussion] Indexing transposes the array?

Jonathan Taylor jonathan.taylor at utoronto.ca
Mon Sep 21 15:36:05 EDT 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