advanced array manipulation there are many ways to work with arrays beyond fancy indexingslicingand boolean subsetting while much of the heavy lifting for data analysis applications is handled by higher level functions in pandasyou may at some point need to write data algorithm that is not found in one of the existing libraries reshaping arrays given what we know about numpy arraysit should come as little surprise that you can convert an array from one shape to another without copying any data to do thispass tuple indicating the new shape to the reshape array instance method for examplesuppose we had one-dimensional array of values that we wished to rearrange into matrixin [ ]arr np arange( in [ ]arr out[ ]array([ ]in [ ]arr reshape(( )out[ ]array([[ ][ ][ ][ ]] multidimensional array can also be reshapedin [ ]arr reshape(( )reshape(( )out[ ]advanced array manipulation www it-ebooks info