How do you change the size of a NumPy array?
Asked in the 1st Round Technical Interview stage. Implement a function that resizes an array to a requested shape using NumPy semantics: flatten values in row-major order, truncate when smaller, and repeat values cyclically when larger. Return the resulting values as a nested Python list for grading.
arr is a non-empty nested list of numbers. new_shape is a list of one to three positive dimensions. Return a nested list matching new_shape.
arr contains at least one numeric value.new_shape contains one to three positive integers.def resize_numpy_array(arr, new_shape):