Python Programming - Arrays - Discussion

Discussion Forum : Arrays - General Questions (Q.No. 79)
79.
What does the expression np.eye(4, k=1) generate?
4x4 identity matrix with ones below the main diagonal.
4x4 identity matrix with ones above the main diagonal.
4x4 identity matrix with ones on the main diagonal.
4x4 identity matrix with zeros below the main diagonal.
Answer: Option
Explanation:
The np.eye() function generates an identity matrix with ones on the main diagonal, and the k parameter shifts the diagonal.
Discussion:
Be the first person to comment on this question !

Post your comments here:

Your comments will be displayed after verification.