1 | initial version |
This is a follow-up to DSM's answer. Just for future reference, I found that I can turn the Trues and Falses into 1's and 0's in the following way:
sage: M = Matrix([[1,2,3],[0,4,5],[0,0,6]])
sage: 1 * ( M.numpy() == 0 )
array([[0, 0, 0],
[1, 0, 0],
[1, 1, 0]])