Modify the formula below so that it rounds to the nearest integer: df2['respiratory_rate'] = df2['respiratory_rate'].fillna( df2.groupby('pulse')['respiratory_rate'].transform('median'))
def round_nearest_int(x): return round(x) df2['respiratory_rate'] = df2['respiratory_rate'].apply(round_nearest_int)