Curriculum
Course: NumPy
Login

Curriculum

NumPy

Text lesson

Floor

The floor() function rounds a decimal down to the nearest lower integer.

For example, the floor of 3.1663.166 is 33.

Example

Apply the floor operation to the elements of the following array:

import numpy as np

arr = np.floor([-3.16663.6667])

print(arr)

Ceil

The ceil() function rounds a decimal up to the nearest upper integer.

For example, the ceiling of 3.1663.166 is 44.

Example

Apply the ceiling operation to the elements of the following array:

import numpy as np

arr = np.ceil([-3.16663.6667])

print(arr)