Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Naming variables in a loop

I have this problem: Lets say i have an matrix A and use A.gram_schmidt() on it. then i get a matrix B whose rows are orthogonal. So what do i do now if i want use the vectors of the rows. How can i make them to variables practical? I tried this:

O, t = A.gram_schmidt() 
for i in range(n):
    wi = O.row(i)

But clearly this doesnt work, because sage doesnt identiy the "i" in "wi"...