python中random模塊的randint與numpy.random模塊的randint

python中random模塊的randint與numpy.random模塊的randint

轉自:http://blog.csdn.net/ztf312/article/details/77871424


這簡直就是python一個大坑

random.randint(a, b)     # 返回閉區間 [a, b] 範圍內的整數值

numpy.random.randint(a, b)   # 返回開區間 [a, b) 範圍內的整數值


random.random()是生成0-1的隨機浮點數

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章