Skip to content

Commit 87c3bd7

Browse files
authored
Merge pull request #24792 from meeseeksmachine/auto-backport-of-pr-24785-on-v3.6.2-doc
2 parents 0dd1770 + f4e8934 commit 87c3bd7

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

examples/animation/bayes_update.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def __call__(self, i):
4747
return self.line,
4848

4949
# Choose success based on exceed a threshold with a uniform pick
50-
if np.random.rand(1,) < self.prob:
50+
if np.random.rand() < self.prob:
5151
self.success += 1
5252
y = beta_pdf(self.x, self.success + 1, (i - self.success) + 1)
5353
self.line.set_data(self.x, y)

examples/animation/strip_chart.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -37,19 +37,19 @@ def update(self, y):
3737
t = self.tdata[0] + len(self.tdata) * self.dt
3838

3939
self.tdata.append(t)
40-
self.ydata.append(float(y))
40+
self.ydata.append(y)
4141
self.line.set_data(self.tdata, self.ydata)
4242
return self.line,
4343

4444

4545
def emitter(p=0.1):
4646
"""Return a random value in [0, 1) with probability p, else 0."""
4747
while True:
48-
v = np.random.rand(1)
48+
v = np.random.rand()
4949
if v > p:
5050
yield 0.
5151
else:
52-
yield np.random.rand(1)
52+
yield np.random.rand()
5353

5454

5555
# Fixing random state for reproducibility

0 commit comments

Comments
 (0)