G
Gordon Williams
Hi,
I have been using this code for a number of weeks without problems. Now I
am getting an exception after the program has run a short while. It has
already passed through this function several hundred time before the
exception.
The code in the function is (exactly as shown):
for i, obsData in enumerate(epochData):
Pcor = obsData[3]
Xs = obsData[4]
Asub, Lsub= Solve_all.model_matrix(Xs[:i+1], Pcor[:i+1],Xr)
The exception is:
Asub, Lsub= Solve_all.model_matrix(Xs[:i+1], Pcor[:i+1],Xr)
UnboundLocalError: local variable 'i' referenced before assignment
What is the problem here? It appears that i has gone out of scope.
Do variables i, obsData get destroyed when you leave the loop? Is this
noted in the docs? I didn't find it.
Does this have anything to do with enumeration?
Why has this worked this far without failing?
Regards,
Gordon Williams
I have been using this code for a number of weeks without problems. Now I
am getting an exception after the program has run a short while. It has
already passed through this function several hundred time before the
exception.
The code in the function is (exactly as shown):
for i, obsData in enumerate(epochData):
Pcor = obsData[3]
Xs = obsData[4]
Asub, Lsub= Solve_all.model_matrix(Xs[:i+1], Pcor[:i+1],Xr)
The exception is:
Asub, Lsub= Solve_all.model_matrix(Xs[:i+1], Pcor[:i+1],Xr)
UnboundLocalError: local variable 'i' referenced before assignment
What is the problem here? It appears that i has gone out of scope.
Do variables i, obsData get destroyed when you leave the loop? Is this
noted in the docs? I didn't find it.
Does this have anything to do with enumeration?
Why has this worked this far without failing?
Regards,
Gordon Williams