I have a code in Jupyter (Python) gives me that warning and doesn't run the code but... well, the "variable" that doesn't run is a function. In one cell I have something like
def rr1(x):
return x[0]+x[1]
And in the next cell I have
def function_2(y,z):
A=np.random.rand(y[0],y[1])
B=rr1(A[0])
C=abs(B)**2
for it in range(z):
[d,e,f]=[rr1(A[it+1]),rr2(A[it+1]),rr3(A[it+1])]
if(things.happen()):
...
for blablabla:
[rr1,rr2,rr3]=[more,things,in_lists]
return blabla
cosa=function_2([3,5],4)
When I try to implement function_2 it gives me the warning local variable rr1 referenced before asignement". Why? What I can do? Well... all the problem was that after using the function a few times, I called a few variables with the name of the function... Brilliant :face_palm: Trying to make the "Minimal, Reproducible example" worked. Many thanks.