在python中导入numpy包

N=5

weights = np.ones(N)/N       //这里就相当于创建了一个数组,且为5个1/5的数组

print "weights", weights

 

------->weights [0.2 0.2 0.2 0.2 0.2]

 

相关文章:

  • 2021-11-19
  • 2022-12-23
  • 2022-12-23
  • 2021-05-26
  • 2021-09-12
猜你喜欢
  • 2021-10-28
  • 2022-01-25
  • 2021-07-29
  • 2021-12-02
  • 2022-02-13
  • 2021-07-20
相关资源
相似解决方案