def merge_with_prev_year(df, year_delta, year_col='year', player_col=
    'player_url'):
    """Merge player stats from previous year."""
    if year_delta < 1:
        raise ValueError('year_delta must be >= 1, got {}!'.format(year_delta))
    prev_year_df = df.copy()
    prev_year_df[year_col] += year_delta
    merged_df = df.merge(prev_year_df, how='left', on=[player_col, year_col
        ], suffixes=('', '___{}'.format(year_delta)))
    return merged_df
