| 1 | initial version |
Python uses negative indices to index from the end.
So for a 3 by 3 matrix, you can think of the indices as 0, 1, 2 or equivalently -3, -2, -1.
In other words you could also think of them as 0, 1, -1.
sage: m = matrix(3, [1 .. 9])
sage: m
[1 2 3]
[4 5 6]
[7 8 9]
sage: m[-1, -1]
9
sage: m[-1, 1]
8
sage: m[1, -1]
6
Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.