numpy.reshape() in Python

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

Syntax

Parameter

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.          

Return

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

Example 1

Output

Pin It on Pinterest

Share This