def odds_to_probability(odds):
    """Converts given odds to probability (proportion)

    Probability is converted to odds using

    .. math::

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

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

    Returns
    ----------
    prob
        Float or array of probabilities

    Examples
    --------
    Convert a single odds to a probability

    >>> from zepid.calc import odds_to_probability
    >>> odds_to_probability(0.45)

    Convert an array of odds to probabilities

    >>> import numpy as np
    >>> odds = np.array([0.3, 0.5, 1, 3.1, 1.1])
    >>> odds_to_probability(odds)
    """
    return odds / (1 + odds)
