def sum_by_week(df, station):
    """Helper function to aggregate data by week per station."""
    df_station = df[df['counting_station'] == station]
    aggregated = df_station.set_index('datetime').resample('1W').agg({
        'velo_in':
        'sum',
        'velo_out':
        'sum'
    }).reset_index()
    aggregated['velo_all'] = aggregated['velo_out'] + aggregated['velo_in']
    aggregated['velo_out'] = -aggregated['velo_out']
    aggregated['counting_station'] = station
    return aggregated