def average_returns(data, **kwargs):
    """ Compute geometric average returns from a returns time serie"""
    average_type = kwargs.get('method', 'net')
    if average_type == 'net':
        relative = 0
    else:
        relative = -1
    period = kwargs.get('period', None)
    if isinstance(period, int):
        pass
    avg_ret = 1
    for idx in range(len(data.index)):
        if idx % period == 0:
            avg_ret *= 1 + data[idx] + relative
    return avg_ret - 1
