[PYTHON] Find the index of the maximum value (minimum value) of a multidimensional array

It seems that this can be done. Note

argmax=lambda A:np.unravel_index(np.array(A).argmax(), np.array(A).shape)
argmin=lambda A:np.unravel_index(np.array(A).argmin(), np.array(A).shape)

To use it, use ```argmax (list) `` `.

Recommended Posts

Find the index of the maximum value (minimum value) of a multidimensional array
I measured 6 methods to get the index of the maximum value (minimum value) of the list
Find the minimum value of a function by particle swarm optimization (PSO)
Find the definition of the value of errno
Find the optimal value of a function with a genetic algorithm (Part 2)
How to find the memory address of a Pandas dataframe value
Find the maximum value python (fixed ver)
Find the number of days in a month
Find the divisor of the value entered in python
[Python numpy] Dynamically specify the index of the array
Output in the form of a python array
[python] How to sort by the Nth Mth element of a multidimensional array
Find the maximum Python
[Python] Precautions when finding the maximum and minimum values in a numpy array with a small number of elements
[Golang] Specify an array in the value of map
Find out the maximum number of characters in multi-line text stored in a data frame
Find out the apparent width of a string in python
Inherit the standard library to find the average value of Queue
Get the value of a specific key up to the specified index in the dictionary list in Python
Multidimensional array initialization of list
Find the maximum value, minimum value, and number of elements when the integer N is on the first line of the standard input and N integers follow.
How to find the scaling factor of a biorthogonal wavelet
Extract the value of dict or list as a string
Find the eigenvalues of a real symmetric matrix in Python
Find the maximum python (improved)
Addictive note: max (max (list)) must not be used when maxing the value of a 2D array
When incrementing the value of a key that does not exist
Count the maximum concatenated part of a random graph with NetworkX
Find the rank of a matrix in the XOR world (rank of a matrix on F2)
Finding the optimum value of a function using a genetic algorithm (Part 1)
[Algorithm x Python] Calculation of basic statistics (total value, maximum value, minimum value)
[Python] A simple function to find the center coordinates of a circle
Find the intersection of a circle and a straight line (sympy matrix)
[Python] Find the second smallest value.
Extract the maximum value with pandas.
About the return value of pthread_mutex_init ()
About the return value of the histogram.
The story of writing a program
[Fundamental Information Technology Engineer Examination] I wrote an algorithm for the maximum value of an array in Python.
[Python] How to use list 2 Reference of list value, number of elements, maximum value, minimum value
I tried to display the altitude value of DTM in a graph
I made a function to see the movement of a two-dimensional array (Python)
A method to check the maximum number of digits after the decimal point when entering pd.Series containing a numerical value
Find the area of the union of overlapping rectangles
Find the dates for a jarring tournament
Measure the relevance strength of a crosstab
Find the SHA256 value with R (with bonus)
A quick overview of the Linux kernel
[python] [meta] Is the type of python a type?
Migemo version of the: find command,: mfind
Get the value of the middle layer of NN
A memo explaining the axis specification of axis
Get the filename of a directory (glob)
The story of blackjack A processing (python)
Notice the completion of a time-consuming command
Find the coefficients of the least squares polynomial
Make the default value of the argument immutable
Function to extract the maximum and minimum values ​​in a slice with Go
I used gawk to find out the maximum value that goes into NF.
Set the number of elements in a NumPy one-dimensional array to a power of 2 (0 padded)
The story of IPv6 address that I want to keep at a minimum