Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

np diag

>>> np.diag(np.diag(x))
array([[0, 0, 0],
       [0, 4, 0],
       [0, 0, 8]])
Source by numpy.org #
 
PREVIOUS NEXT
Tagged: #np #diag
ADD COMMENT
Topic
Name
3+8 =