I have a dataframe like this :
Id relationship age
1 1001 1 60
2 1001 2 50
3 1001 3 20
4 1002 1 70
5 1002 2 68
6 1002 3 23
7 1002 3 27
8 1002 3 27
9 1002 3 23
10 1003 1 60
11 1003 2 40
12 1003 3 20
13 1003 3 20
I want to write big age of each Id for all member of same Id in new column and name it maxage. I need this result:
Id relationship age maxage
1 1001 1 60 60
2 1001 2 50 60
3 1001 3 20 60
4 1002 1 70 70
5 1002 2 68 70
6 1002 3 23 70
7 1002 3 27 70
8 1002 3 27 70
9 1002 3 23 70
10 1003 1 60 60
11 1003 2 40 60
12 1003 3 20 60
13 1003 3 20 60