Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/310.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python *的操作数类型不受支持:';功能';和';功能';具有lambda函数_Python - Fatal编程技术网

Python *的操作数类型不受支持:';功能';和';功能';具有lambda函数

Python *的操作数类型不受支持:';功能';和';功能';具有lambda函数,python,Python,我知道我可以将两个lambda函数相乘,得到一个lambda函数,如下所示: f1 = lambda x: x+2 f2 = lambda x: x+3 f = lambda x: f1*f2 # f = (x+2)*(x+3) = x**2 + 5*x + 6 我得到以下行的TypeError: integ = lambda x:(low_vib_wfxn)*(up_vib_wfxn) (低振动)和(高振动)都是lambda函数: low_vib_wfxn = lambda x:(l

我知道我可以将两个lambda函数相乘,得到一个lambda函数,如下所示:

f1 = lambda x: x+2
f2 = lambda x: x+3
f = lambda x: f1*f2 
 # f = (x+2)*(x+3) = x**2 + 5*x + 6
我得到以下行的TypeError:

 integ = lambda x:(low_vib_wfxn)*(up_vib_wfxn)
(低振动)和(高振动)都是lambda函数:

low_vib_wfxn = lambda x:(low_norm_const) * (H_list[0]) * (math.exp((-low_aplpha)*(x^2)*(1/2)))

A = lambda x: (norm_up_vib_wfxn_list[k]) * (H_list[k])

up_vib_wfxn = lambda x: A * (math.exp((-up_aplpha)*(x**2)*(1/2)))
H_列表是参数为x的多项式列表


有人能解释一下我为什么会出现打字错误,以及我是如何解决这个问题的吗?

也许你想要的是:

f = lambda x: f1(x) * f2(x) 

“我知道我可以将两个lambda函数相乘得到一个lambda函数”-不,你不能将函数(lambda或不)相乘得到一个新函数,正如你所看到的。