I have a dataframe like this:
df = pd.DataFrame()
df['vals'] = [1,2,3,4,5]
df['flagged'] = ['N','Y','N','N','Y']
What is this most idiomatic way of modifying the values column, where the flag is 'Y'. For example, add 5 to each flagged value, so that df['vals'] == [1,7,3,4,10]
.