There is a function that I am trying to integrate into Python with scipy.integrate.quad. This particular function takes two arguments. There is only one argument that I want to integrate. An example is shown below.
from scipy import integrate as integrate
def f(x,a):
return a*x
result = integrate.quad(f,0,1)
This example does not work (you think it is clear), because Python reminds me when I try it:
TypeError: f() takes exactly 2 arguments (1 given)
I am wondering how to use a integrate.quad()variable to integrate into a single value when this function is, generally speaking, a function with several variables, with additional variables providing the parameters of the function.
source
share