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
this is probably something simple but I can't quite figure it out. Any help would be greatly appreciated. Thanks in advance
You have forgotten a *
between -3.7
and (prof[x])
.
Thus:
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)))
Also, there seems to be missing an (
as I count 6 times (
and 7 times )
, and I think (math.e, (0/2.25))
is missing a function call (probably math.pow
, but thats just a wild guess).
The problem is with -3.7(prof[x])
, which looks like a function call (note the parens). Just use a *
like this -3.7*prof[x]
.
Source: Stackoverflow.com