numpy/reshape

Reshape

Reshape an array

numpy
array
reshape

Command

arr.reshape(new_shape)

Explanation

Change the dimensions of an array without changing its data.

Examples

Reshape into 2x6 array

arr.reshape(2, 6)