This is documentation for an old release of NumPy (version 1.3.). Read this page Search for this page in the documentation of the latest stable release (version > 1.17).
numpy.rint
-
numpy.rint(x[, out])
Round elements of the array to the nearest integer.
Parameters: | x : array_like
Input array.
|
Returns: | out : ndarray
Output array is same shape and type as x.
|
Examples
>>> a = [-4.1, -3.6, -2.5, 0.1, 2.5, 3.1, 3.9]
>>> np.rint(a)
array([-4., -4., -2., 0., 2., 3., 4.])