Let’s check how to find minimum and maximum in Numpy Python library.
Using built-in methods
The easiest way to find the min and max values of an array is to use the built-in functions Numpy offers.
import numpy as np my_array = np.array([1, 56, 55, 15, -555, 43]) minimum_value = np.min(my_array) maximum_value = np.max(my_array) print(f"Min value in the array: {minimum_value}") print(f"Max value in the array: {maximum_value}")
Minimum and maximum values of the whole array have been returned by Numpy.