Whenever you assign a value to a variable in a given scope, the variable is considered local to that scope. Depending on which Python you are using, you need to either use non-local (Python 3) or pass values when using parameters (Python 2).
Here is Python 2 :
def toFloat(puntosX, aproxY, puntosY):
puntosX = [float(x) for x in puntosX]
aproxY = [float(y) for y in aproxY]
puntosY = [float(y) for y in puntosY]
Python 3:
def toFloat():
nonlocal puntosX, aproxY, puntosY
puntosX = [float(x) for x in puntosX]
aproxY = [float(y) for y in aproxY]
puntosY = [float(y) for y in puntosY]
global , .
, . , . ( .) , () . , Python 2:
def taylorVazquez(fx,a,b,n,puntos):
puntosX = linspace(a,b,num=puntos)
aproxY = []
puntosY = []
def toFloat(puntosX, aproxY, puntosY):
puntosX = [float(x) for x in puntosX]
aproxY = [float(y) for y in aproxY]
puntosY = [float(y) for y in puntosY]
return puntosX, aproxY, puntosY
puntosX, aproxY, puntosY = toFloat(puntosX, aproxY, puntosY)
global, .