I am trying to use values from an array in the following equation:
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)))
When I run I receive the following error:
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
What is the cause, and how can the problem be resolved?
There is an operator missing, likely a
*:The “is not callable” occurs because the parenthesis — and lack of operator which would have switched the parenthesis into precedence operators — make Python try to call the result of
-3.7(a float) as a function, which is not allowed.The parenthesis are also not needed in this case, the following may be sufficient/correct:
As Legolas points out, there are other things which may need to be addressed: