Guest User

Untitled

a guest
Oct 12th, 2019
29
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. pi = [0.1, 0.9] #probabaility
  2. mu = [-1, 1] #means
  3. sigma = [0.1 , 0.2] #spreads.
  4. Ns = 100
  5. choices = random.choices( np.arange( len(pi) ), pi, k=Ns)
  6.  
  7. def onenumber(i, mu=mu,sigma=sigma):
  8. return float (np.random.normal(mu[i], sigma[i] , 1))
  9.  
  10. S = [onenumber(i) for i in choices]
RAW Paste Data