[问题] numpy.random.randint的用法解释

楼主: WengeKong (早知道就去欧洲定居)   2019-08-02 12:36:29
看document
https://
docs.scipy.org/doc/numpy-1.15.1/reference/generated/numpy.random.randint.html
low : int
Lowest (signed) integer to be drawn from the distribution
(unless high=None, in which case this parameter is one above the highest such
integer).
可是为什么下面范例
np.random.randint(2, size=10)
抽出的值是0跟1?
(unless high=None, in which case this parameter is one above the highest such
integer).
this parameter "2" is one above the highest such integer
的意思是说 抽出的最大值是2-1
这样理解对吗? such integer说的是抽出的integer?
作者: legendmtg (CLANNAD)   2019-08-02 15:05:00
除非你有给high 否则low就是high
作者: germun (ger)   2019-08-02 15:28:00
high是None的情况下, 你给的low会当成high, 而low默认为0range也是类似的做法

Links booklink

Contact Us: admin [ a t ] ucptt.com