Python Programming - Arrays - Discussion

Discussion Forum : Arrays - General Questions (Q.No. 60)
60.
How can you extract the diagonal elements from a NumPy array arr?
np.diagonal(arr)
arr.extract_diagonal()
arr.get_diagonal()
np.diag(arr)
Answer: Option
Explanation:
The np.diagonal() function extracts the diagonal elements from the array.
Discussion:
Be the first person to comment on this question !

Post your comments here:

Your comments will be displayed after verification.