Articles → Numpy → Find the minimum and maximum value in NumPy arrays

Find the minimum and maximum value in NumPy arrays






Example


import numpy as np

# Create an array 
arr = np.random.randint(0,30,10)

print("Array:", arr)
print("Minimum value in array", arr.min())
print("Index of min value in array", arr.argmin())
print("Maximum value in array", arr.max())
print("Index of min value in array", arr.argmax())
















Picture showing the minimum and maximum value of the numpy array

Click to Enlarge


Posted By  -  Karan Gupta
 
Posted On  -  Wednesday, March 27, 2019

Query/Feedback


Your Email Id  
 
Subject 
 
Query/FeedbackCharacters remaining 250