Question: Let arr be a 1 - dimensional NumPy array. Assuming that all the elements in arr are nonnegative floating - point numbers. Write a function

Let arr be a 1-dimensional NumPy array. Assuming that all the elements in arr are nonnegative floating-point
numbers. Write a function that rounds all the numbers in arr to the nearest integers.
Hint: Operators // and % might be helpful.
For example, if arr is [1.4,0.3,3.8,89.0,0,0.5,44], you should return [1,0,4,89,0,1,44] instead of [1.0.4.
89.0.1.44.]

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!