Home »
Python »
Python NumPy MCQs
Observe the following code and identify what will be the outcome (2)?
7. Observe the following code and identify what will be the outcome?
import numpy as np
x = np.array([[0, 1],
[2, 3]])
np.transpose(x)
-
array([[0, 2],
[1, 3]])
-
array([[0, 1],
[2, 3]])
-
array([[2, 3],
[0, 1]])
- None of the mentioned above
Answer: A)
array([[0, 2],
[1, 3]])
Explanation:
In the above code, an array has been declared and stored in a variable x. And then, matrix transposed and print.