How can I change the sign in the quantity column whenever a side column sells? All other values should not be changed. The following simply does not work, it does not work.
df[df['side'] == 'Sell']['quantity'] = df[df['side'] == 'Sell']['quantity'] * -1
source
share