import numpy as np
import random
import matplotlib.pyplot as plt

L = list(range(33, 170, 1))

l = [a/10 for a in L]

ll = [0]*100
for i in range(1000000):
    x = round(random.uniform(0, 99))
    ll[x] = ll[x] + 1
    
plt.plot(list(range(100)), ll)

【random.uniform()】是随机分布

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-01-09
  • 2021-11-13
  • 2021-05-08
  • 2021-09-10
  • 2022-02-21
  • 2021-12-06
  • 2022-01-21
相关资源
相似解决方案