【发布时间】:2011-10-19 06:37:51
【问题描述】:
我正在尝试在以下等式中使用数组中的值:
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
这可能很简单,但我不太明白。任何帮助都是 不胜感激。提前致谢
【问题讨论】:
-
您在这里缺少一个操作:
-3.7(prof[x])它应该是-3.7 * (prof[x])或 ... -
我在一个类中遇到了同样的异常,我有一个浮点属性和一个同名的方法。重命名两者之一为我解决了它