Jun-02-2023, 05:29 AM
I'm trying to get ceiling value of the input for two decimals.
array([-1.78, -1.59, -0.24, 0.26, 1.5 , 1.75, 2. ])
array([-1., -1., -0., 1., 2., 2., 2.])
array([-2., -2., -1., 0., 1., 1., 2.])
Is there a way I can use Numpy ceil and floor methods to get such values to nearest second decimal?
1 2 3 4 |
import numpy as np a = np.array([ - 1.784 , - 1.5888 , - 0.24444 , 0.25555 , 1.5 , 1.75 , 2.0 ]) np.around(a, 2 ) |
1 |
np.ceil(a) |
1 |
np.floor(a) |
Is there a way I can use Numpy ceil and floor methods to get such values to nearest second decimal?