Hello, Sage Community!
Since I learned Sage, I have used the notation A[i][j]
(which obviously came from my previous experience with Python lists) to access the (i+1, j+1)-th element of a matrix. However, I discovered a few weeks ago that I can also use the syntax A[i,j]
. I am wondering which of these two ways of matrix indexing is preferred in Sage?
My tests using timeit
indicate that the second syntax is faster than the first one by a factor of 500. So I suppose it to be simply natural that the fastest syntax is preferred. However, why to deviate from the list syntax? After all, lists and lists of lists are (in some sense) arrays, too.
Thanks in advance for your answers!