I am wanting to divide column a
by 10 when groupby id
= 2 and update the original df
. Not too sure how to do this one!
df
date id a b c d
0 1/1/2000 1 10 20 10.0 11
1 1/1/2000 2 100 21 1.0 11
2 1/1/2000 3 15 20 14.0 11
3 1/1/2000 4 10 24 13.0 11
4 1/2/2000 1 10 25 10.0 11
5 1/2/2000 2 100 20 13.0 15
6 1/2/2000 3 10 26 22.0 11
7 1/2/2000 4 10 20 16.0 13
8 1/3/2000 1 10 20 10.0 11
9 1/3/2000 2 100 20 13.0 11
10 1/3/2000 3 10 20 18.0 11
11 1/3/2000 4 10 20 10.0 11
desired dataframe
date id a b c d
0 1/1/2000 1 10 20 10.0 11
1 1/1/2000 2 10 21 1.0 11
2 1/1/2000 3 15 20 14.0 11
3 1/1/2000 4 10 24 13.0 11
4 1/2/2000 1 10 25 10.0 11
5 1/2/2000 2 10 20 13.0 15
6 1/2/2000 3 10 26 22.0 11
7 1/2/2000 4 10 20 16.0 13
8 1/3/2000 1 10 20 10.0 11
9 1/3/2000 2 10 20 13.0 11
10 1/3/2000 3 10 20 18.0 11
11 1/3/2000 4 10 20 10.0 11