1. Solution: Your problem is that the T function expects a value, but you are passing a list. Instead of print T(data[0],[0.29,4.5]) to get a list of results:
print [T(val,[0.29,4.5]) for val in data[0]]
Or use the wrapper function:
def arrayT(array, params): return [T(val, params) for val in array] print arrayT(data[0], [0.29, 4.5])
2. The decision. You must change your mathematical expression. Somehow the sims don't work with a list of lists, so try the following:
expr = "2*y/z*(x**(z-1)-x**(-1-z/2))" T=lambdify((x,y,z),expr,'numpy') print T(data[0], 0.29, 4.5)
miindlek
source share