Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/animation/bayes_update.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def __call__(self, i):
return self.line,

# Choose success based on exceed a threshold with a uniform pick
if np.random.rand(1,) < self.prob:
if np.random.rand() < self.prob:
self.success += 1
y = beta_pdf(self.x, self.success + 1, (i - self.success) + 1)
self.line.set_data(self.x, y)
Expand Down
6 changes: 3 additions & 3 deletions examples/animation/strip_chart.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,19 +37,19 @@ def update(self, y):
t = self.tdata[0] + len(self.tdata) * self.dt

self.tdata.append(t)
self.ydata.append(float(y))
self.ydata.append(y)
self.line.set_data(self.tdata, self.ydata)
return self.line,


def emitter(p=0.1):
"""Return a random value in [0, 1) with probability p, else 0."""
while True:
v = np.random.rand(1)
v = np.random.rand()
if v > p:
yield 0.
else:
yield np.random.rand(1)
yield np.random.rand()


# Fixing random state for reproducibility
Expand Down