scipy.stats.rv_discrete.

rvs#

rv_discrete.rvs(*args, **kwargs)[原始碼]#

給定類型的隨機變數。

參數:
arg1, arg2, arg3,…array_like

分布的形狀參數 (更多資訊請參閱實例物件的文檔字串)。

locarray_like, optional

位置參數 (預設值=0)。

sizeint 或 ints 的 tuple, optional

定義隨機變數的數量 (預設值為 1)。請注意,size 必須作為關鍵字給定,而不是作為位置參數。

random_state{None, int, numpy.random.Generator,

如果 random_state 為 None (或 np.random),則使用 numpy.random.RandomState singleton。如果 random_state 為 int,則使用新的 RandomState 實例,並以 random_state 作為種子。如果 random_state 已經是 GeneratorRandomState 實例,則使用該實例。

回傳值:
rvsndarray 或 scalar

給定 size 的隨機變數。