We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Prepare
- Python
- Numpy
- Floor, Ceil and Rint
- Discussions
Floor, Ceil and Rint
Floor, Ceil and Rint
Sort by
recency
|
279 Discussions
|
Please Login in order to post a comment
import numpy as np np.set_printoptions(legacy='1.13')
a = input().split() x = np.array(a,dtype = float)
print(np.floor(x)) print(np.ceil(x)) print(np.rint(x))
For Python3
code is
import numpy
numpy.set_printoptions(legacy='1.13')
my_arr = list(map(float, input().split()))
print(numpy.floor(my_arr)) print(numpy.ceil(my_arr)) print(numpy.rint(my_arr))