However it only evaluates along a single axis and returns the index of the minimum value along a single row/column whereas I wish to evaluate the whole array and return the lowest value not the indices.

numpy.argmin does not by default evaluate along a single axis, the default is to evaluate along the flattened matrix and it returns the linear index in the flattened array; from the numpy docs that you linked:

By default, the index is into the flattened array, otherwise along the specified axis.

Either way, use numpy.amin or numpy.min to return the minimum value, or equivalently for an array arrname use arrname.min(). As you mentioned, numpy.argmin returns the index of the minimum value (of course, you can then use this index to return the minimum value by indexing your array with it). You could also flatten into a single dimension array with arrname.flatten() and pass that into the built-in min function.

The four following methods produce what you want.

import numpy as np

values = np.array([
    [8,2,3,4,5,6],
    [3,6,6,7,2,6],
    [3,8,5,1,2,9],
    [6,4,2,7,8,3]])

values.min()          # = 1
np.min(values)        # = 1
np.amin(values)       # = 1
min(values.flatten()) # = 1
Answer from alkasm on Stack Overflow
🌐
NumPy
numpy.org › doc › 2.2 › reference › generated › numpy.minimum.html
numpy.minimum — NumPy v2.2 Manual
Element-wise maximum of two arrays, propagates NaNs. ... Element-wise minimum of two arrays, ignores NaNs.
🌐
NumPy
numpy.org › doc › 2.2 › reference › generated › numpy.min.html
numpy.min — NumPy v2.2 Manual
The maximum value of an array along a given axis, propagating any NaNs. ... The minimum value of an array along a given axis, ignoring any NaNs.
🌐
NumPy
numpy.org › doc › 2.1 › reference › generated › numpy.matrix.min.html
numpy.matrix.min — NumPy v2.1 Manual
Return the minimum value along an axis · This is the same as ndarray.min, but returns a matrix object where ndarray.min would return an ndarray
🌐
ProjectPro
projectpro.io › recipes › compute-min-by-max-for-each-row-for-numpy-array-2d
How to compute the min-by-max for each row for a numpy array 2d? -
June 20, 2022 - print("The minimum value from each row is:","\n",np.min(Sample_array, axis=1),"\n") print("The maximum value from each row is:","\n",np.max(Sample_array, axis=1)) The minimum value from each row is: [1 4 7] The maximum value from each row is: ...
🌐
Sharp Sight
sharpsight.ai › blog › numpy-min
Numpy Min, Explained - Sharp Sight
February 6, 2024 - Specifically, we’re going to set axis = 0 inside of np.min. Once again, we’ll be operating on our 2D array, myarray_2d. ... As you can see here, this is a 2D array with 3 rows and 3 columns.
🌐
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.
Find elsewhere
🌐
GeeksforGeeks
geeksforgeeks.org › python › find-the-maximum-and-minimum-element-in-a-numpy-array
Find the maximum and minimum element in a NumPy array - GeeksforGeeks
August 13, 2021 - If we use 0 it will give us a list containing the maximum or minimum values from each column. Here we will get a list like [11 81 22] which have all the maximum numbers each column.
🌐
NumPy
numpy.org › doc › stable › reference › generated › numpy.matrix.min.html
numpy.matrix.min — NumPy v2.4 Manual
January 31, 2021 - Return the minimum value along an axis · This is the same as ndarray.min, but returns a matrix object where ndarray.min would return an ndarray
🌐
Programiz
programiz.com › python-programming › numpy › methods › min
NumPy min()
numpy.min(array, axis = None, out = None, keepdims = <no value>, initial=<no value>, where=<no value>) ... The min() method returns the smallest element. Note: If at least one element of the input array is NaN, min() will return NaN. The axis argument defines how we can handle the smallest ...
🌐
NumPy
numpy.org › doc › 2.1 › reference › generated › numpy.argmin.html
numpy.argmin — NumPy v2.1 Manual
>>> import numpy as np >>> a = np.arange(6).reshape(2,3) + 10 >>> a array([[10, 11, 12], [13, 14, 15]]) >>> np.argmin(a) 0 >>> np.argmin(a, axis=0) array([0, 0, 0]) >>> np.argmin(a, axis=1) array([0, 0]) Indices of the minimum elements of a N-dimensional array:
🌐
NumPy
numpy.org › doc › stable › reference › generated › numpy.argmin.html
numpy.argmin — NumPy v2.4 Manual
>>> import numpy as np >>> a = np.arange(6).reshape(2,3) + 10 >>> a array([[10, 11, 12], [13, 14, 15]]) >>> np.argmin(a) 0 >>> np.argmin(a, axis=0) array([0, 0, 0]) >>> np.argmin(a, axis=1) array([0, 0]) Indices of the minimum elements of a N-dimensional array:
🌐
DataCamp
datacamp.com › doc › numpy › argmin
NumPy argmin()
If `axis` is `None`, the array is flattened, and the index of the overall minimum value is returned. The function returns an integer representing the zero-based index of the first occurrence of the minimum value. import numpy as np array = np.array([5, 3, 7, 1, 9]) index_min = np.argmin(array) print(index_min)
🌐
NumPy
numpy.org › doc › 2.0 › reference › generated › numpy.matrix.min.html
numpy.matrix.min — NumPy v2.0 Manual
Return the minimum value along an axis · This is the same as ndarray.min, but returns a matrix object where ndarray.min would return an ndarray