Project 26: Price Rounding Tool
Data Engineer
Builds on these lessons
Current Task
Objective
NumPy has several rounding ufuncs: np.round (nearest, to N decimals), np.floor (rounds down), and np.ceil (rounds up).
Task: print a prices array rounded to 1 decimal, floored, and ceiled.
index.py
import numpy as np
prices = np.array([42.567, 100.123, 7.891])
print(np.round(prices, 1))
print(np.floor(prices))
print(np.ceil(prices))
* Hint: Correct characters turn green, incorrect ones turn red.
Live Preview
🖼️
Verify your code to see the preview