Modify the formula below so that it rounds to the nearest integer, but not less than 1 and not more than 4: df2['respiratory_rate'] = df2['respiratory_rate'].fillna( df2.groupby('pulse')['respiratory_rate'].transform('median'))
def round_to_four(a, b): return round(a + b) round_to_four(1.2, 3.1)