例如我有dataframe叫df
Prices Amount Action C
0 3 57 Sell 1
1 89 42 Sell 1
2 45 70 Buy -1
3 6 43 Sell 1
4 60 47 Sell 1
5 19 16 Buy -1
6 56 89 Sell 1
7 3 28 Buy -1
8 56 69 Sell 1
9 90 49 Buy -1
目前使用的辦法是
df['Prices'].apply(lambda x :x/df['Prices'].sum())
感覺特別慢,有什麼更快的辦法嗎?