Complete the code to find the minimum value in the array.
import numpy as np arr = np.array([3, 7, 1, 9, 5]) min_value = np.[1](arr) print(min_value)
The np.min() function returns the smallest value in the array.
Complete the code to find the maximum value in the 2D array.
import numpy as np arr = np.array([[4, 2, 8], [1, 7, 5]]) max_value = np.[1](arr) print(max_value)
The np.max() function returns the largest value in the array.
Fix the error in the code to correctly find the minimum value along axis 0.
import numpy as np arr = np.array([[10, 20], [5, 15]]) min_values = np.min(arr, [1]=0) print(min_values)
The correct parameter name to specify the axis is axis.
Fill both blanks to create a dictionary of max values for each column in the array.
import numpy as np arr = np.array([[3, 6, 9], [2, 8, 5]]) max_dict = {i: np.[1](arr, [2]=0)[i] for i in range(arr.shape[1])} print(max_dict)
Use np.max() to find max values and axis to specify the dimension.
Fill all three blanks to create a dictionary of min values for each row in the array.
import numpy as np arr = np.array([[7, 4, 1], [3, 9, 6]]) min_dict = {i: np.[1](arr, [2]=1)[[3]] for i in range(arr.shape[0])} print(min_dict)
Use np.min() to find minimum values, axis to specify dimension, and i as the axis index.
