本文簡要介紹 python 語言中 numpy.random.Generator.standard_exponential
的用法。
用法:
random.Generator.standard_exponential(size=None, dtype=np.float64, method='zig', out=None)
從標準 index 分布中抽取樣本。
standard_exponential
與尺度參數為 1 的 index 分布相同。- size: int 或整數元組,可選
輸出形狀。例如,如果給定的形狀是
(m, n, k)
,則繪製m * n * k
樣本。默認為無,在這種情況下返回單個值。- dtype: dtype,可選
結果的所需dtype,僅支持
float64
和float32
。字節序必須是原生的。默認值為 np.float64。- method: str,可選
‘inv’ 或 ‘zig’。 ‘inv’ 使用默認的逆 CDF 方法。 ‘zig’ 使用 Marsaglia 和 Tsang 更快的 Ziggurat 方法。
- out: ndarray,可選
用於放置結果的替代輸出數組。如果 size 不是 None,它必須與提供的 size 具有相同的形狀,並且必須匹配輸出值的類型。
- out: 浮點數或 ndarray
繪製的樣本。
參數:
返回:
例子:
輸出一個 3x8000 數組:
>>> n = np.random.default_rng().standard_exponential((3, 8000))
相關用法
- Python numpy Generator.standard_normal用法及代碼示例
- Python numpy Generator.standard_t用法及代碼示例
- Python numpy Generator.standard_cauchy用法及代碼示例
- Python numpy Generator.standard_gamma用法及代碼示例
- Python numpy Generator.shuffle用法及代碼示例
- Python numpy Generator.multivariate_normal用法及代碼示例
- Python numpy Generator.bytes用法及代碼示例
- Python numpy Generator.choice用法及代碼示例
- Python numpy Generator.random用法及代碼示例
- Python numpy Generator.logseries用法及代碼示例
- Python numpy Generator.uniform用法及代碼示例
- Python numpy Generator.normal用法及代碼示例
- Python numpy Generator.poisson用法及代碼示例
- Python numpy Generator.power用法及代碼示例
- Python numpy Generator.geometric用法及代碼示例
- Python numpy Generator.laplace用法及代碼示例
- Python numpy Generator.vonmises用法及代碼示例
- Python numpy Generator.noncentral_f用法及代碼示例
- Python numpy Generator.gamma用法及代碼示例
- Python numpy Generator.multivariate_hypergeometric用法及代碼示例
- Python numpy Generator.weibull用法及代碼示例
- Python numpy Generator.gumbel用法及代碼示例
- Python numpy Generator.pareto用法及代碼示例
- Python numpy Generator.noncentral_chisquare用法及代碼示例
- Python numpy Generator.negative_binomial用法及代碼示例
注:本文由純淨天空篩選整理自numpy.org大神的英文原創作品 numpy.random.Generator.standard_exponential。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。