# Correct Answer?

image

Can any one let me what will be the correct answer for that

2 Likes

Thank you for sharing this @sriv.ansh
We will look into it

Already shows, that option #3 is Correct.

Here’s the basic syntax of the reshape() function:

numpy.reshape(array, new_shape)

Parameters:

  • array: The input array that you want to reshape.
  • new_shape: The desired shape of the array. It can be specified as a single integer or as a tuple of integers representing the dimensions.

Here’s an example that demonstrates the usage of reshape() :

Create a 1D array with 12 elements
arr = np.array([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12])

Reshape the array to a 2D array with 3 rows and 4 columns
reshaped_arr = np.reshape(arr, (3, 4))

print(“Original array:”)
print(arr)

print(“\nReshaped array:”)
print(reshaped_arr)

Original array:
[ 1 2 3 4 5 6 7 8 9 10 11 12]

Reshaped array:
[[ 1 2 3 4]
[ 5 6 7 8]
[ 9 10 11 12]]