emat/util/distributions.py
def binary(p=0.5, p_true=None, p_false=None):
	"""
	Generate a frozen scipy.stats.bernoulli distribution.

	The bernoulli distribution is for True/False outcomes,
	but allows for weighted (i.e. not 50%) probability of True.

	Args:
		p (numeric, default 0.5):
			The probability of a 'True' outcome.
		p_true (numeric, optional):
			Alias for `p`.
		p_false (numeric, optional):
			Alternative argument, will set `p` to the complement.  Ignored if
			`p_true` is also given.

	Returns:
		scipy.stats.rv_frozen
	"""
	if p_true is not None:
		p = p_true
	elif p_false is not None:
		p = 1-p_false
	return bernoulli(p=p)

	Generate a frozen scipy.stats.bernoulli distribution.

	The bernoulli distribution is for True/False outcomes,
	but allows for weighted (i.e. not 50%) probability of True.

	Args:
		p (numeric, default 0.5):
			The probability of a 'True' outcome.
		p_true (numeric, optional):
			Alias for `p`.
		p_false (numeric, optional):
			Alternative argument, will set `p` to the complement.  Ignored if
			`p_true` is also given.

	Returns:
		scipy.stats.rv_frozen
	
Generate a frozen scipy.stats.bernoulli distribution.
The bernoulli distribution is for True/False outcomes,
but allows for weighted  probability of True.
Generate a frozen scipy . stats . bernoulli distribution . The bernoulli distribution is for True / False outcomes but allows for weighted probability of True .
def binary(p=0.5, p_true=None, p_false=None):
	if p_true is not None:
		p = p_true
	elif p_false is not None:
		p = 1-p_false
	return bernoulli(p=p)
def binary ( p = 0.5 , p_true = None , p_false = None ) : if p_true is not None : p = p_true elif p_false is not None : p = 1 - p_false return bernoulli ( p = p )
Generate a frozen scipy.stats.bernoulli distribution.
Generate a frozen scipy . stats . bernoulli distribution .
"""
	Generate a frozen scipy.stats.bernoulli distribution.

	The bernoulli distribution is for True/False outcomes,
	but allows for weighted (i.e. not 50%) probability of True.

	Args:
		p (numeric, default 0.5):
			The probability of a 'True' outcome.
		p_true (numeric, optional):
			Alias for `p`.
		p_false (numeric, optional):
			Alternative argument, will set `p` to the complement.  Ignored if
			`p_true` is also given.

	Returns:
		scipy.stats.rv_frozen
	"""
None
p
The probability of a 'True' outcome.
The probability of a ' True ' outcome .
p_true
Alias for `p`.
Alias for ` p ` .
p_false
Alternative argument, will set `p` to the complement.  Ignored if
`p_true` is also given.
Alternative argument will set ` p ` to the complement . Ignored if ` p_true ` is also given .