DekGenius.com
Home
(current)
Dictionary
BOOKS
LYRICS
CHORD
SCRIPT & CODE EXAMPLE
Karaoke language
Search
Go
SCRIPT & CODE EXAMPLE
CODE EXAMPLE FOR PYTHON
sum of diagonal numpy
arr= np.arange(16) arr= np.reshape(arr,(4,4)) a=np.diagonal(arr, 0,0,1) result=sum(a) print(result)
Source by numpy.org #
PREVIOUS
NEXT
Tagged:
#sum
#diagonal
#numpy
ADD COMMENT
Topic
COMMENT
Name
8+7 =
Submit