Parallel Python Community Forums

Python Forums => Parallel Python Forum => Topic started by: chiodo85 on August 02, 2017, 09:15:59 AM



Title: TypeError: float() argument must be a string or a number
Post by: chiodo85 on August 02, 2017, 09:15:59 AM
qj  takes values from a previously defined array

XI from a matrix


relevant code:

.....

def B(x, qj, XI):
    return np.cos(qj*x)/np.sqrt(XI+np.cosh(x))

def integrate_trapezoidal(f, start, fin, N, qj, XI):
    x = np.linspace(start, fin, N)
    bin = (fin-start)/(2*N)
    area = (bin)*(2*np.sum(f(x, qj, XI)) - f(x[0], qj, XI) - f(x[N-1], qj, XI))
    return area

result1 = np.zeros(shape=(10, 10))

result1[j, k] = job_server.submit (integrate_trapezoidal, args=(0., 1000., 1e4, q[j], XI[j][k]), depfuncs=(B,))

______________________________________________________________

why do I get the error, for the last line (result1[j, k]........): "TypeError: float() argument must be a string or a number"????