NumPy - Array Manipulation
Which of the following correctly converts a 2D NumPy array
arr into a 1D array using ravel()?arr into a 1D array using ravel()?ravel() method must be called on the array object with parentheses.arr.ravel() which returns a flattened 1D array. flat_arr = np.ravel is just a reference to the function without calling it. flat_arr = arr.flatten misses parentheses, so it returns a method object, not the flattened array. flat_arr = np.flatten(arr) uses a non-existent np.flatten() function.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions