bernoulli#
- class bernoulli(p=0.5, **kwargs)[source]#
Bases:
Dist
Bernoulli distribution: return True or False with the specified probability (which can be an array)
Unlike other distributions, Bernoulli distributions have a filter() method, which returns elements of the array that return True.
- Parameters:
p (float) – the probability of returning True (default 0.5)
Attributes
bitgen
state
Get the current state
state_int
Get the integer corresponding to the current state
Methods