Can someone explain to me my why this is an invalid syntax? It comes in the line before the last line.
import random
class BernoulliArm():
def __init__(self, p):
self.p=p
def draw(self):
if random.random()>self.p:
return 0.0
else:
return 1.0
means = [0.1, 0.1, 0.1, 0.1, 0.9]
n_arms = len(means)
random.shuffle(means)
arms = map(lambda (mu):BernoulliArm(mu), means)
arms[0].draw()