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

filter(uids=None, both=False)[source]#

Return UIDs that correspond to True, or optionally return both True and False

split(uids=None)[source]#

Alias to filter(uids, both=True)

call_par(key, val, size, uids)[source]#

Reverse the usual order of processing so callable is processed first, and then the timepar conversion