Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何scipy有效地从伯努利分布中提取数字?
scipy
您可以利用伯努利分布是二项分布的特例这一事实n=1。
n=1
例子:
import scipy as sp p = 0.2 sp.random.binomial(1, p)