Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

You could also do something like:

sage: A=matrix(QQ,3,3,[3,-1,1,3,6,2,3,3,7]) sage: A.numpy().diagonal() array([3, 6, 7])

You could also do something like:

 sage: A=matrix(QQ,3,3,[3,-1,1,3,6,2,3,3,7]) 
   sage: A.numpy().diagonal() 
   array([3, 6, 7])

7])