elements corresponding to each tuple of indicesmore on reshape in in [ ]arr np arange( reshape(( )in [ ]arr out[ ]array([ ] ] ][ ][ ][ ][ ][ ]]in [ ]arr[[ ][ ]out[ ]array( ]take moment to understand what just happenedthe elements ( )( )( )and ( were selected the behavior of fancy indexing in this case is bit different from what some users might have expected (myself included)which is the rectangular region formed by selecting subset of the matrix' rows and columns here is one way to get thatin [ ]arr[[ ]][:[ ]out[ ]array([ ][ ][ ] ]]another way is to use the np ix_ functionwhich converts two integer arrays to an indexer that selects the square regionin [ ]arr[np ix_([ ][ ])out[ ]array([ ][ ][ ] ]]keep in mind that fancy indexingunlike slicingalways copies the data into new array transposing arrays and swapping axes transposing is special form of reshaping which similarly returns view on the underlying data without copying anything arrays have the transpose method and also the special attributein [ ]arr np arange( reshape(( )in [ ]arr in [ ]arr the numpy ndarraya multidimensional array object www it-ebooks info