df = pd.DataFrame([['Dog', 5, 2], ['Dog', 3, 4], ['Cat', 1, 7], ['Dog', np.
    nan, 3], ['Cow', np.nan, 2]], columns=['Type', 'Killed', 'Survived'])
df.Killed = df.groupby('Type').Killed.transform(lambda x: x.fillna(x.mean()))
df
Pandas fillna() на основе определенного атрибута столбца