Python has a min() built-in function:

Copy>>> darr = [1, 3.14159, 1e100, -2.71828]
>>> min(darr)
-2.71828
Answer from Greg Hewgill on Stack Overflow
🌐
Tutorialspoint
tutorialspoint.com › python › list_min.htm
Python List min() Method
Traceback (most recent call last):File "main.py", line 2, in <module>print("min value element : ", str(min(list1)))TypeError: '<' not supported between instances of 'str' and 'int'
Discussions

Is there a way to use Python's min function to find the min in a subset of a list instead of the entire list?
You could give min() a slice of the list consisting of the part between the indexes. More on reddit.com
🌐 r/learnpython
6
7
December 13, 2021
Find the index of the minimum value in a list?
You could try a.index(min(a)) More on reddit.com
🌐 r/learnpython
12
2
June 18, 2015
min() vs 'sort() and then list[0]'

As others have mentioned, min will be quicker. min just has to walk through the list once, whereas sort must do more compares, making it more complex.

However, one case you might want to use sort is when you need more than just the minimum. Eg. you want the 5 smallest items, not just the smallest. Here "sorted(mylist)[:5]" will do the job, but another option to keep in mind is the heapq module, as "heapq.nsmallest(5, mylist)" will often perform better than sort, at least for a small number of items.

More on reddit.com
🌐 r/Python
36
29
February 23, 2012
How to find the minimum value in an array?
There is a min() function for this (that works even though you have the hyphens: >>> a = [1, 2, 3, '-'] >>> min(a) 1 So you should just be able to do the following: for key, value in matrix.iteritems(): min_value = min(value) NOTE: If you are using python 3 you should just use matrix.items() instead of iteritems() (which is just a python 2 thing). More on reddit.com
🌐 r/learnpython
8
October 30, 2015
🌐
NumPy
numpy.org › doc › 2.2 › reference › generated › numpy.min.html
numpy.min — NumPy v2.2 Manual
Minimum of a. If axis is None, the result is a scalar value. If axis is an int, the result is an array of dimension a.ndim - 1.
🌐
Codecademy
codecademy.com › docs › python:numpy › built-in functions › .min()
Python:NumPy | Built-in Functions | .min() | Codecademy
June 9, 2025 - This example shows how to find the minimum value of an entire array and along specific axes: ... Machine Learning Data Scientists solve problems at scale, make predictions, find patterns, and more! They use Python, SQL, and algorithms.
🌐
BinaryFish
binary-fish.vercel.app › blog › pythonmaxmin
How to get max and min value of an array in python.
January 8, 2024 - scores = [0,100,200,300] print(min(scores)) #returns 0, the smallest in the array "scores" # = 0 · In Python, you can create an array, full of functions to perform with. In this article, it will explain to you how to get the minimum and the ...
🌐
Programiz
programiz.com › python-programming › numpy › methods › min
NumPy min()
# pass the 'out' argument to store the result in array2 np.min(array1, axis = 0, out = array2) print(array2) ... When keepdims = True, the dimensions of the resulting array matches the dimension of an input array.
🌐
Mimo
mimo.org › glossary › python › min
Python min(): Syntax, Usage, and Examples
Python · Open in Mimo · Open in Mimo · Copy Code · lists = [[3, 4, 1], [8, 2], [9, 0]] min_overall = min(min(lst) for lst in lists) print(min_overall) # Output: 0 · This works well for matrices or nested data structures. When working with numerical data, the numpy module provides its own ...
Find elsewhere
🌐
Spark By {Examples}
sparkbyexamples.com › home › python › how to calculate minimum() of array in numpy?
How to Calculate minimum() of Array in NumPy? - Spark By {Examples}
March 27, 2024 - In this article, I will explain how to get the minimum values of 1-D arrays in element-wise and multi-D arrays along with specified axes using syntax and parameters of numpy.minimum() function with examples.
🌐
Python Data Science Handbook
jakevdp.github.io › PythonDataScienceHandbook › 02.04-computation-on-arrays-aggregates.html
Aggregations: Min, Max, and Everything In Between | Python Data Science Handbook
By default, each NumPy aggregation function will return the aggregate over the entire array: ... Aggregation functions take an additional argument specifying the axis along which the aggregate is computed. For example, we can find the minimum value within each column by specifying axis=0:
🌐
DataCamp
datacamp.com › doc › numpy › min
NumPy min()
Handle edge cases. Consider scenarios like empty arrays or arrays with `NaN` values. Note that `numpy.min()` will return `NaN` if any `NaN` values are present.
🌐
Vultr Docs
docs.vultr.com › python › third-party › numpy › min
Python Numpy min() - Find Minimum Value | Vultr Docs
November 18, 2024 - The np.min() function first finds the overall minimum in the matrix, which is 0. Using the axis parameter, it then finds the minimums for each row and each column. Create an array that includes NaN (Not a Number) values.
🌐
NumPy
numpy.org › doc › stable › › reference › generated › numpy.min.html
numpy.min — NumPy v2.4 Manual
Minimum of a. If axis is None, the result is a scalar value. If axis is an int, the result is an array of dimension a.ndim - 1.
🌐
W3Schools
w3schools.com › python › ref_func_min.asp
Python min() Function
Python Examples Python Compiler Python Exercises Python Quiz Python Challenges Python Server Python Syllabus Python Study Plan Python Interview Q&A Python Bootcamp Python Certificate Python Training ... The min() function returns the item with the lowest value, or the item with the lowest value in an iterable.
🌐
HowToDoInJava
howtodoinjava.com › home › python examples › python max() and min(): find max and min in array
Python max() and min(): Find max and min in Array
September 21, 2023 - Rerun the previous example with min() function. prices = { 'how': 45.23, 'to': 612.78, 'do': 205.55, 'in': 37.20, 'java': 10.75 } minKey = min( prices.keys() ) print(minKey) # do minVal = min( prices.values() ) print(minVal) # 10.75 · The max() and min() functions in Python are powerful tools for finding the maximum and minimum values within arrays and other iterable objects.
🌐
NumPy
numpy.org › doc › stable › reference › generated › numpy.minimum.html
numpy.minimum — NumPy v2.4 Manual
Compare two arrays and return a new array containing the element-wise minima. If one of the elements being compared is a NaN, then that element is returned. If both elements are NaNs then the first is returned. The latter distinction is important for complex NaNs, which are defined as at least ...
🌐
NumPy
numpy.org › devdocs › reference › generated › numpy.min.html
numpy.min — NumPy v2.5.dev0 Manual
Minimum of a. If axis is None, the result is a scalar value. If axis is an int, the result is an array of dimension a.ndim - 1.
🌐
TutorialsPoint
tutorialspoint.com › return-the-minimum-of-an-array-or-minimum-ignoring-any-nans-in-python
Return the minimum of an array or minimum ignoring any ...
February 28, 2022 - This function returns a scalar value or a NumPy array containing the minimum values along the specified axis, ignoring NaN values. Following is a basic example of finding the minimum value in an array using the NumPy nanmin() function, while ...
🌐
GeeksforGeeks
geeksforgeeks.org › python › numpy-minimum-in-python
numpy.minimum() in Python - GeeksforGeeks
December 19, 2025 - If either element is NaN, that NaN is returned. If both are NaN, the first one is returned. Example: This example shows how numpy.minimum() compares two numbers and returns the smaller one.
🌐
NumPy
numpy.org › doc › 2.1 › reference › generated › numpy.min.html
numpy.min — NumPy v2.1 Manual
Minimum of a. If axis is None, the result is a scalar value. If axis is an int, the result is an array of dimension a.ndim - 1.