Calculate

Return

# simple return
def to_returns(prices):
    """
    Calculates the simple arithmetic returns of a price series.
    Formula is: (t1 / t0) - 1
    Args:
        * prices: Expects a price series
    """
    return prices / prices.shift(1) - 1

Last updated