I am having a similar dataframe like below.
group_name field_A
0 g1 3
1 g1 49
2 g1 90
3 g2 78
4 g2 92
5 g2 76
6 g2 48
7 g3 33
8 g3 44
9 g3 55
I want to process above dataframe and check group wise values and if the value of field_A is above 75%tile of the all group values then add 'Yes' in a new column which is 'isAboveThreshold'. so it will look like
group_name field_A top isTop75
0 g1 3 69.5 No
1 g1 49 69.5 No
2 g1 90 69.5 Yes
3 g2 78 81.5 No
4 g2 92 81.5 Yes
5 g2 76 81.5 No
6 g2 48 81.5 No
7 g3 33 49.5 No
8 g3 44 49.5 No
9 g3 55 49.5 Yes