def probability_to_odds(prob):
    """Converts given probability (proportion) to odds

    Probability is converted to odds using

    .. math::

        O = \\frac{\\Pr}{1 - \\Pr}

    Parameters
    ---------------
    prob : float, NumPy array
        Probability or array of probabilities to transform into odds

    Returns
    ----------
    odds
        Float or array of odds

    Examples
    --------
    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)
    """
    return prob / (1 - prob)
