Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit87c3bd7

Browse files
authored
Merge pull request#24792 from meeseeksmachine/auto-backport-of-pr-24785-on-v3.6.2-doc
2 parents0dd1770 +f4e8934 commit87c3bd7

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

‎examples/animation/bayes_update.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def __call__(self, i):
4747
returnself.line,
4848

4949
# Choose success based on exceed a threshold with a uniform pick
50-
ifnp.random.rand(1,)<self.prob:
50+
ifnp.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

Lines changed: 3 additions & 3 deletions
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
returnself.line,
4343

4444

4545
defemitter(p=0.1):
4646
"""Return a random value in [0, 1) with probability p, else 0."""
4747
whileTrue:
48-
v=np.random.rand(1)
48+
v=np.random.rand()
4949
ifv>p:
5050
yield0.
5151
else:
52-
yieldnp.random.rand(1)
52+
yieldnp.random.rand()
5353

5454

5555
# Fixing random state for reproducibility

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp