[ ]]one of the passed shape dimensions can be - in which case the value used for that dimension will be inferred from the datain [ ]arr np arange( in [ ]arr reshape(( - )out[ ]array([ ] ] ] ][ ]]since an array' shape attribute is tupleit can be passed to reshapetooin [ ]other_arr np ones(( )in [ ]other_arr shape out[ ]( in [ ]arr reshape(other_arr shapeout[ ]array([ ] ][ ]]the opposite operation of reshape from one-dimensional to higher dimension is typically known as flattening or ravelingin [ ]arr np arange( reshape(( )in [ ]arr ravel(out[ ]array( in [ ]arr out[ ]array([ ] ] ] ][ ]] ]ravel does not produce copy of the underlying data if it does not have to (more on this belowthe flatten method behaves like ravel except it always returns copy of the datain [ ]arr flatten(out[ ]array( ]the data can be reshaped or raveled in different orders this is slightly nuanced topic for new numpy users and is therefore the next subtopic versus fortran order contrary to some other scientific computing environments like and matlabnumpy gives you much more control and flexibility over the layout of your data in advanced numpy www it-ebooks info