Converts given probability (proportion) to odds

Probability is converted to odds using

\[O = \frac{\Pr}{1 - \Pr}\]
Parameters:prob (float, NumPy array) – Probability or array of probabilities to transform into odds
Returns:Float or array of odds
Return type:odds


Convert a single probability to an odds

>>> from zepid.calc import probability_to_odds
>>> probability_to_odds(0.3)

Convert an array of probabilities to odds

>>> import numpy as np
>>> probs = np.array([0.3, 0.1, 0.2, 0.5, 0.01])
>>> probability_to_odds(probs)