numpy.reshape() in Python

The numpy.reshape() function gives a new shape to an array without changing its data.



The numpy.reshape() method consists of three parameters, which are as follows:

array : It represents our input array

shape : This represents int value or tuples of int.

order : This parameter can be either C_contiguous or F_contiguous where C order operates row-rise on the array and  F order operates column-wise operations.          


This function returns an array which is reshaped without changing the data.

Example 1


Pin It on Pinterest

Share This