Generation

generate functionMon, 13 Feb 2023

Write a formula that rounds all non-integer values to the nearest integer in the Pandas column

def round_floats(df, col): return df[col].apply(np.round)

Questions about programming?Chat with your personal AI assistant