This function is used to round the array elements to the nearest integer.
numpy.rint(array)
An array containing the rounded values is returned.
import numpy as np arr = [0.23, 0.09, 1.2, 1.24, 9.99] print("Input array:",arr) r_arr = np.rint(arr) print("Output array:",r_arr)
Output: