当侧列有售出时,如何才能翻转数量列中的符号?所有其他值不应更改。以下代码根本没有作用。 df[df['side'] == 'Sell']['quantity'] = df[df['side'] == 'Sell']['quantity'] * -1