Parameters :
array: [array_like] Input array.
decimal: [int, optional] Decimal places we want to round off.Default = 0. In case of -ve decimal, it specifies the n0. of positions to the left of the decimal point.
out: [optional] Output resulted array
Return:
An array with all array elements being rounded off, having same type as input
Code # 1: Work
|
|
Output:
Input array: [1, 4, 7, 9, 12] Rounded values: [1 4 7 9 12] Input array: [133, 344, 437 , 449, 12] Rounded values upto 2: [100 300 400 400 0] Input array: [133, 344, 437, 449, 12] Rounded values upto 3: [0 0 0 0 0]
Links:
https: / /docs.scipy.org/doc/numpy-dev/reference/generated/numpy.around.html#numpy.around
,
Shop
Latest questions