特色的高排名答案只适用于只有两列的熊猫数据框。如果有更多列的情况,请使用:
df['Crude_Birth_rate'] = df.groupby("continent").Crude_Birth_rate.transform( lambda x: x.fillna(x.mean()))