Jun-02-2023, 05:29 AM
I'm trying to get ceiling value of the input for two decimals.
Is there a way I can use Numpy ceil and floor methods to get such values to nearest second decimal?
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)array([-1.78, -1.59, -0.24, 0.26, 1.5 , 1.75, 2. ])
np.ceil(a)array([-1., -1., -0., 1., 2., 2., 2.])
np.floor(a)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?