leider bekomme ich den folgenden Code nicht zu laufen:
Code: Alles auswählen
import math
def lg(a):
return math.log(a)/math.log(2.0)
if __name__ == "__main__":
temp = list("AXDA .255 .245 .245 .255".split())
s1 = temp[0]
model1 = temp[1::]
temp = list("CYEC .225 .275 .275 .225 ".split())
s2 = temp[0]
model2 = temp[1::]
lod = map(lambda x: [lg(model1[x]/model2[x]) ], range(0,4))
print lod
Code: Alles auswählen
Traceback (most recent call last):
File "x.py", line 21, in ?
lod = map(lambda x: [lg(model1[x]/model2[x]) ], range(0,4))
File "x.py", line 21, in <lambda>
lod = map(lambda x: [lg(model1[x]/model2[x]) ], range(0,4))
TypeError: unsupported operand type(s) for /: 'str' and 'str'
Viele Grüße