Master round(), around(), floor(), ceil(), trunc(), and fix() for precision control.
NumPy provides comprehensive rounding functions for engineering and financial precision: `np.floor` rounds down, `np.ceil` rounds up, and `np.round` rounds to decimal places.
Floor is dropping down to the ground; Ceil is reaching up to the ceiling; Trunc is slicing off the decimal tail without looking at rounding.
`np.round(arr, decimals=N)` rounds to N decimal places using standard round-half-to-even bankers rounding.
r = np.round(arr, decimals=2)np.round(1.555, 2) # Python scalar round vs NumPy array roundnp.round(np.array([1.555]), 2)NumPy's `np.round()` works on both scalars and entire arrays simultaneously.
Solve the objective below using NumPy vectorized syntax
Create `arr = np.array([1.23, 4.56, 7.89])`, round to 1 decimal place using `np.round(arr, decimals=1)`, and print.
[1.2 4.6 7.9]