First time here? Check out the FAQ!

Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

answered 14 years ago

Jason Grout gravatar image

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])

click to hide/show revision 2
No.2 Revision

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])