dpnp.around

dpnp.around(x1, decimals=0, out=None)[source]

Evenly round to the given number of decimals.

For full documentation refer to numpy.around.

Limitations

Parameters x1 is supported as dpnp.ndarray. Parameters decimals and out are supported with their default values. Otherwise the functions will be executed sequentially on CPU. Input array data types are limited by supported DPNP Data types.

Examples

>>> import dpnp as np
>>> np.around([0.37, 1.64])
array([0.,  2.])
>>> np.around([0.37, 1.64], decimals=1)
array([0.4,  1.6])
>>> np.around([.5, 1.5, 2.5, 3.5, 4.5]) # rounds to nearest even value
array([0.,  2.,  2.,  4.,  4.])
>>> np.around([1,2,3,11], decimals=1) # ndarray of ints is returned
array([ 1,  2,  3, 11])
>>> np.around([1,2,3,11], decimals=-1)
array([ 0,  0,  0, 10])