我正在尝试在以下等式中使用数组中的值:
for x in range(len(prof)):
PB = 2.25 * (1 - math.pow(math.e, (-3.7(prof[x])/2.25))) * (math.e, (0/2.25)))
当我运行时,我收到以下错误:
Traceback (most recent call last):
File "C:/Users/cwpapine/Desktop/1mPro_Chlavg", line 240, in <module>
PB = float(2.25 * (1 - math.pow(math.e, (-3.7(prof[x])/2.25))) * (math.e, (0/2.25)))
TypeError: 'float' object is not callable
这可能很简单,但我无法弄清楚。任何帮助将不胜感激。提前致谢
原文由 Corey 发布,翻译遵循 CC BY-SA 4.0 许可协议
缺少一个运算符,可能是
*
:“ _不可调用_”的出现是因为括号 - 并且缺少将括号切换为优先运算符的运算符 - 使 Python 尝试将
-3.7
(浮点数)的结果作为函数 _调用_,这是不允许的。在这种情况下也不需要括号,以下可能是充分/正确的:
正如 Legolas 所指出的,还有其他可能需要解决的问题: