Ask Your Question
0

List Object not Callable

asked 2020-07-18 00:49:29 +0100

whatupmatt gravatar image

link text

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 flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2020-07-18 02:09:41 +0100

jaydfox gravatar image

updated 2020-07-18 02:19:24 +0100

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)
edit flag offensive delete link more

Comments

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

whatupmatt gravatar imagewhatupmatt ( 2020-07-18 19:37:19 +0100 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2020-07-18 00:49:29 +0100

Seen: 647 times

Last updated: Jul 18 '20