Refer to this answer, which also elaborates how to find the max value and its (1D) index, you can use argmax()

>>> a = array([[10,50,30],[60,20,40]])
>>> maxindex = a.argmax()
>>> maxindex
3

You can then use unravel_index(a.argmax(), a.shape) to get the indices as a tuple:

>>> from numpy import unravel_index
>>> unravel_index(a.argmax(), a.shape)
(1, 0)
Answer from Chandrika Joshi on Stack Overflow
๐ŸŒ
NumPy
numpy.org โ€บ doc โ€บ stable โ€บ reference โ€บ generated โ€บ numpy.argmax.html
numpy.argmax โ€” NumPy v2.4 Manual
>>> x = np.array([[4,2,3], [1,0,3]]) >>> index_array = np.argmax(x, axis=-1) >>> # Same as np.amax(x, axis=-1, keepdims=True) >>> np.take_along_axis(x, np.expand_dims(index_array, axis=-1), axis=-1) array([[4], [3]]) >>> # Same as np.amax(x, axis=-1) >>> np.take_along_axis(x, np.expand_dim...
Discussions

python - Finding the Max value in a two dimensional Array - Stack Overflow
Communities for your favorite technologies. Explore all Collectives ยท Stack Overflow for Teams is now called Stack Internal. Bring the best of human thought and AI automation together at your work More on stackoverflow.com
๐ŸŒ stackoverflow.com
Python index of max value in 2D list
counts = [ ["08:00", 50], ["08:15", 47], ["08:30": 66], ["08:45", 52] ] How do I find the time of the greatest count? max(zip(*.counts)[1]) will return the value 66. I'm looking for some version of counts.index() to be return the index so I can retrieve the time (which in the application is ... More on forum.inductiveautomation.com
๐ŸŒ forum.inductiveautomation.com
1
0
July 1, 2023
python - Find index of max value in each row of 2D array - Stack Overflow
I would like to find the indices for the max value in each row of the array. I am currently only getting ind_max_amp = [15 15 15 15 15 15 15 15 15 15] which I presume is the column of each max value. What I need is tuples: (0,15) (1,15) etc... Also, could anyone help me finding the index of 90% ... More on stackoverflow.com
๐ŸŒ stackoverflow.com
python - how to get the max of each column from an 2d array + index of the max value - Stack Overflow
And at the same time I would like to receive the index of the max value from each column. Is this possible? I don't find immediatly the sollution within the np.array basic doc. More on stackoverflow.com
๐ŸŒ stackoverflow.com
๐ŸŒ
w3resource
w3resource.com โ€บ python-exercises โ€บ numpy โ€บ python-numpy-exercise-120.php
Python NumPy: Get the index of a maximum element in a numpy array along one axis - w3resource
August 29, 2025 - # Importing the NumPy library and ... np.unravel_index() to get the indices of the maximum element in the array 'a' # The argmax() function finds the index of the maximum value in the flattened array # The unravel_index() function ...
๐ŸŒ
ListenData
listendata.com โ€บ home โ€บ python
NumPy argmax() Function : Learn with Examples
When we use axis=0 argument in the argmax() function, it means that we want to find the indices of the maximum elements along each column of the array. In simple words, it returns the index of the maximum value for each column.
๐ŸŒ
Vultr Docs
docs.vultr.com โ€บ python โ€บ third-party โ€บ numpy โ€บ argmax
Python Numpy argmax() - Find Maximum Index | Vultr Docs
April 10, 2025 - Consider a two-dimensional array. Apply np.argmax() without specifying an axis to find the overall maximum index. Use the axis parameter to get the index of the max value in a 2D NumPy array along a specified axis.
๐ŸŒ
Geekflare
geekflare.com โ€บ development โ€บ how to use the numpy argmax() function in python
How to Use the NumPy argmax() Function in Python
December 29, 2024 - In this tutorial, you will learn how to use the NumPy argmax() function to find the index of the maximum element in arrays, with examples.
๐ŸŒ
Inductive Automation
forum.inductiveautomation.com โ€บ ignition
Python index of max value in 2D list - Ignition - Inductive Automation Forum
July 1, 2023 - counts = [ ["08:00", 50], ["08:15", 47], ["08:30": 66], ["08:45", 52] ] How do I find the time of the greatest count? max(zip(*.counts)[1]) will return the value 66. I'm looking for some version of counts.index() to be return the index so I can retrieve the time (which in the application is ...
Find elsewhere
๐ŸŒ
Quora
quora.com โ€บ How-can-I-find-the-maximum-value-in-the-first-column-in-an-array-in-Python
How to find the maximum value in the first column in an array in Python - Quora
To get the maximum now, I first use a list comprehension to gather the 0th element of each list in an_array as a list and then max for the maximum value. ... Python doesnโ€™t have arrays in its core interpreter.
๐ŸŒ
Analytics Vidhya
analyticsvidhya.com โ€บ home โ€บ all you need to know about numpyโ€™s argmax() function
All You Need to Know About NumPy's argmax() Function
May 28, 2025 - To find the maximum value index along a specific axis in a multi-dimensional array, we can specify the axis parameter in the np.argmax() function. This allows us to find the maximum value and corresponding index along a particular dimension.
๐ŸŒ
NumPy
numpy.org โ€บ doc โ€บ 2.2 โ€บ reference โ€บ generated โ€บ numpy.argmax.html
numpy.argmax โ€” NumPy v2.2 Manual
>>> x = np.array([[4,2,3], [1,0,3]]) >>> index_array = np.argmax(x, axis=-1) >>> # Same as np.amax(x, axis=-1, keepdims=True) >>> np.take_along_axis(x, np.expand_dims(index_array, axis=-1), axis=-1) array([[4], [3]]) >>> # Same as np.amax(x, axis=-1) >>> np.take_along_axis(x, np.expand_dim...
๐ŸŒ
Python Forum
python-forum.io โ€บ thread-13441.html
finding 2 max values in an array in python
I have an array in Python and i want to find the two largest values in that array and their corresponding position in that array. Can anyone please share the approach for it?
๐ŸŒ
Real Python
realpython.com โ€บ numpy-max-maximum
NumPy's max() and maximum(): Find Extreme Values in Arrays โ€“ Real Python
January 18, 2025 - In this introduction to NumPy, you'll learn how to find extreme values using the max() and maximum() functions. This includes finding the maximum element in an array or along a given axis of an array, as well as comparing two arrays to find ...
๐ŸŒ
Educative
educative.io โ€บ answers โ€บ find-the-maximum-value-in-each-row-and-column-of-a-numpy-2d-array
Find the maximum value in each row and column of a NumPy 2D array
In this shot we will discuss on how to find the maximum value across each row and each column in a NumPy 2D array. To solve the problem mentioned above, we will use amax() method from the numpy python package.
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ python-maximum-column-values-in-mixed-length-2d-list
Python โ€“ Maximum column values in mixed length 2D List | GeeksforGeeks
April 17, 2023 - The combination of the above three functions combined with list comprehension can help us perform this particular task, the max function helps to perform the maximization, filter allows us to check for the present elements and all rows are combined using the map function. Works only with python 2.
๐ŸŒ
Stack Overflow
stackoverflow.com โ€บ questions โ€บ 61229657 โ€บ find-index-of-max-value-in-each-row-of-2d-array
python - Find index of max value in each row of 2D array - Stack Overflow
@CristianContrera max_amp (which is np.amax) returns the maximum value rather than index. I think this question asks for indices. ... @CristianContrera Please go ahead and run your code (regardless of missing parentheses type), your code output is: [(15, 16), (15, 32), (15, 48), (15, 64), (15, 80), (15, 96), (15, 112), (15, 128), (15, 144), (15, 160)]. And this is just the example. The question asks for : I would like to find the indices for the max value in each row of the array.
๐ŸŒ
Codecademy
codecademy.com โ€บ docs โ€บ python:numpy โ€บ ndarray โ€บ .argmax()
Python:NumPy | ndarray | .argmax() | Codecademy
October 31, 2025 - In this example, the .argmax() method finds the indices of maximum values along each axis in a two-dimensional array: ... In this example, the .argmax() method returns the index of the maximum element from the flattened version of the array:
๐ŸŒ
NumPy
numpy.org โ€บ doc โ€บ 2.0 โ€บ reference โ€บ generated โ€บ numpy.argmax.html
numpy.argmax โ€” NumPy v2.0 Manual
>>> x = np.array([[4,2,3], [1,0,3]]) >>> index_array = np.argmax(x, axis=-1) >>> # Same as np.amax(x, axis=-1, keepdims=True) >>> np.take_along_axis(x, np.expand_dims(index_array, axis=-1), axis=-1) array([[4], [3]]) >>> # Same as np.amax(x, axis=-1) >>> np.take_along_axis(x, np.expand_dim...