Python Programming - Arrays - Discussion

Discussion Forum : Arrays - General Questions (Q.No. 57)
57.
What does the NumPy function numpy.diag([1, 2, 3]) do?
Creates a 3x3 array with values 1, 2, and 3 on the main diagonal.
Generates a diagonal matrix with values 1, 2, and 3.
Reshapes an existing array to have dimensions 1x3.
Computes the determinant of a 3x3 matrix.
Answer: Option
Explanation:
The numpy.diag() function creates a diagonal matrix with the specified values on the main diagonal.
Discussion:
Be the first person to comment on this question !

Post your comments here:

Your comments will be displayed after verification.