Question: For this assignment, you should not use loops! You should be using vectorized operations. Functional iterators are also not allowed. The following operations will be
For this assignment, you should not use loops! You should be using vectorized operations. Functional iterators are also not allowed. The following operations will be deducted: for, while, comprehensions (like [x for x in range(10)], map(), and filter().
Create a new file called np_exercises.py. Put all functions in there.
Write a function called numpy_close which takes in two Numpy arrays a and b, as well as a third optional argument tol which defaults to 1e-8. It should return True if the arrays have the same shape and the absolute difference of each corresponding pair of elements less than tol.
Your function should be able to work on arrays of arbitrary dimensions (they could be 1-D, 2-D, 8-D, etc.)
Use Python 3.8
Thank you
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
