# List Object not Callable

Hello, see the link given above. Apparently, I need 60 points to upload images. So the idea is I am trying to construct a matrix by appending lists to each row. I am not understanding the error I am receiving.

CoefficientwList is just a list of numbers. From the second picture, you can see that Separation4 maps a list to a list of lists. By typing Separation4(CoefficientwList)[i1], I am extracting the i1th list in the list of lists. I then apply the vector function to make this list a vector and then from the 3rd picture, you see I add it to a row of the matrix M. Is there anything wrong here?

If more info is needed, please tell me but I am not seeing what the issue is.

edit retag close merge delete

Sort by » oldest newest most voted

I can't see all the code, so I'm not sure exactly what's going on. But this particular line looks like a red flag:

 for vector in CoefficientsforSpan:


In that loop, you replaced the standard function vector() with a new variable vector. This wasn't a problem in that loop. However, the next time you tried to call the vector() function to build a new vector, it tried to use the previous vector variable instead. And that variable was an actual vector, not a function, so the error message you are seeing is just telling you that you can't call it.

Change the name of vector in that loop, and it might fix your problem. You might need to reload the notebook to fix the vector function. I can't seem to find which module it's loaded from, or I'd give you the import command to fix it. (Update: found it: from sage.modules.free_module_element import vector)

Edit: I just noticed, even further up in the code, you used vector as a variable. You'll need to use a different variable name. The code in question:

vector=NewMatrix.solve_left(Quotient[i])
CoefficientsforSpan.append(vector)

more

Yeah, using the vector as a function and as a name was the issue. Thanks!

( 2020-07-18 19:37:19 +0200 )edit