Reputation: 43
I get the error as in the title of my post. I have seen this come up in other questions, but I am interested in understanding what this means since the other answers were in a specific context that does not apply to me.
Secondly, I would like to understand how this applies to my code, shown below. Note that this all works OK if Zindx = 0, but not for any other case.
Zindx = list(E).index(0)
for m in range(0,N):
if m != Zindx:
for n in range(0,N):
if n != Zindx:
if n != m:
x[m,m] = x[m,m] (
- (E[n]-E[m] + E[n])*x[m,n]*x[n,Zindx]
/x[m,Zindx]/E[m]
)
Upvotes: 3
Views: 5078
Reputation: 2137
This:
x[m,m] (
- (E[n]-E[m] + E[n])*x[m,n]*x[n,Zindx]
/x[m,Zindx]/E[m]
)
Is trying to call x[m,m]
as a function with the expression within the parenthesis as an argument. I am guessing x[m,m]
returns a float
.
Do you mean to multiply x[m,m]
by the term in the parenthesis? If so, add the *
.
Upvotes: 3