I have a dataframe
A B
0 1 100.0
1 1 NaN
2 1 200.0
3 2 100.0
4 2 NaN
Group according to column A, then find the average of each group B column, and finally complete the null value of column B. The expected output is as follows.
A B
0 1 100
1 1 150
2 1 200
3 2 100
4 2 100