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)
  1. array([[0, 2],
           [1, 3]])
  2. array([[0, 1],
           [2, 3]])
  3. array([[2, 3],
           [0, 1]])
  4. 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.

Comments and Discussions!

Load comments ↻






Copyright © 2024 www.includehelp.com. All rights reserved.