jamestha3d

randoms3

May 16th, 2021
592
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import numpy as np
  2. import random
  3. import math
  4. x = np.random.randint(1,200, size=10000)
  5. sp = random.sample((list(x)),100)
  6.  
  7.  
  8. meen = []
  9. for item in range (0,50000):
  10.     sp = random.sample((list(x)),100)
  11.     m = np.mean(sp)
  12.     meen.append(m)
  13.  
  14. meen.sort()
  15.  
  16.  
  17. frq = [0]
  18. frq_index = 0
  19. last_seen = 85
  20. import math
  21. for i in range(50000):
  22.     if meen[i] >= 85 and meen[i] < 116:
  23.         num = math.floor(meen[i])
  24.         if num == last_seen:
  25.             frq[frq_index] += 1
  26.         else:
  27.             zeroes = num - last_seen
  28.             for i in range(zeroes):
  29.                 frq.append(0)
  30.             frq_index += zeroes
  31.             last_seen += zeroes
  32.             frq[frq_index] += 1
  33.  
  34. print(frq)
  35.  
RAW Paste Data