File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed
Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff 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 )
Original file line number Diff line number Diff 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
4545def 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
You can’t perform that action at this time.
0 commit comments