malee/_malee.py
def twr(rors):
    """The Time-Weighted Return (also called the
    Geometric Average Return) is a way of calculating
    the rate of return for an investment when there are
    deposits and withdrawals (cash flows) during the period.
    You often want to exclude these cash flows so that we can
    find out how well the underlying investment has performed.

    Args:
        rors: List of all rors over multiple time periods

    Returns:
        The time-weighted return of a given investment

    Example:
        By providing a list of rate of returns you can
        calculate the time-weighted return based on that
        list:

        >>> import malee
        >>> malee.aar([.10, -.05, .12])
        0.056666666666666664
    """
    Rtw = 1
    for ror in rors:
        Rtw *= 1 + ror
    return Rtw - 1
The Time-Weighted Return (also called the
    Geometric Average Return) is a way of calculating
    the rate of return for an investment when there are
    deposits and withdrawals (cash flows) during the period.
    You often want to exclude these cash flows so that we can
    find out how well the underlying investment has performed.

    Args:
        rors: List of all rors over multiple time periods

    Returns:
        The time-weighted return of a given investment

    Example:
        By providing a list of rate of returns you can
        calculate the time-weighted return based on that
        list:

        >>> import malee
        >>> malee.aar([.10, -.05, .12])
        0.056666666666666664
    
The Time-Weighted Return (also called the
Geometric Average Return) is a way of calculating
the rate of return for an investment when there are
deposits and withdrawals (cash flows) during the period.
You often want to exclude these cash flows so that we can
find out how well the underlying investment has performed.
The Time - Weighted Return ( also called the Geometric Average Return ) is a way of calculating the rate of return for an investment when there are deposits and withdrawals ( cash flows ) during the period . You often want to exclude these cash flows so that we can find out how well the underlying investment has performed .
def twr(rors):
    Rtw = 1
    for ror in rors:
        Rtw *= 1 + ror
    return Rtw - 1
def twr ( rors ) : Rtw = 1 for ror in rors : Rtw *= 1 + ror return Rtw - 1
The Time-Weighted Return (also called the
Geometric Average Return) is a way of calculating
the rate of return for an investment when there are
deposits and withdrawals (cash flows) during the period.
The Time - Weighted Return ( also called the Geometric Average Return ) is a way of calculating the rate of return for an investment when there are deposits and withdrawals ( cash flows ) during the period .
"""The Time-Weighted Return (also called the
    Geometric Average Return) is a way of calculating
    the rate of return for an investment when there are
    deposits and withdrawals (cash flows) during the period.
    You often want to exclude these cash flows so that we can
    find out how well the underlying investment has performed.

    Args:
        rors: List of all rors over multiple time periods

    Returns:
        The time-weighted return of a given investment

    Example:
        By providing a list of rate of returns you can
        calculate the time-weighted return based on that
        list:

        >>> import malee
        >>> malee.aar([.10, -.05, .12])
        0.056666666666666664
    """
The time-weighted return of a given investment
The time - weighted return of a given investment
rors
List of all rors over multiple time periods
List of all rors over multiple time periods
examples
By providing a list of rate of returns you can
calculate the time-weighted return based on that
list.


By providing a list of rate of returns you can calculate the time - weighted return based on that list .