NumPy | Python Methods and Functions

** numpy.argmax (array, axis = None, out = None): ** returns the indices of the max element of the array on a specific axis.

**Parameters:**

array:Input array to work onaxis:[int, optional] Along a specified axis like 0 or 1out:[array optional] Provides a feature to insert output to theoutarray and it should be of appropriate shape and dtype

** Return: **

Array of indices into the array with same shape as array.shape with the dimension along axis removed.

** Code 1 : **

` ` |

** Output: **

INPUT ARRAY: [[0 1 2 3] [4 5 6 7] [8 9 10 11]] Max element : 11 Indices of Max element: [2 2 2 2] Indices of Max element: [3 3 3]

** Code 2: **

` ` |

** Output: **

INPUT ARRAY: [[0 3 8 13] [12 11 2 11] [5 13 8 3] [12 15 3 4]] Max element: 15 Indices of Max element: [1 3 0 0] Indices of Max element: [3 0 1 1]

** Code 3: **

` ` |

** Output: **

array: [[0 1 2 3 4] [5 6 7 8 9]] array: [[0 6 2 3 4] [5 6 7 8 9]] array: 9 MAX ELEMENT INDICES: [1 0 1 1 1]

** Links: **

https:// docs. scipy.org/doc/numpy-dev/reference/generated/numpy.argm ax.html # numpy.argmax

** Notes: **

These codes will not work for online IDs. Please run them on your systems to see how they work

This article is provided by ** Mohit Gupta_OMG
**

We live in an age of so-called Big Data. We hear terms like data scientist, and there is much talk about analytics and the mining of large amounts of corporate data for tidbits of business value. Ther...

10/07/2020

R for Everyone: Advanced Analytics and Graphics. ...

28/08/2021

IRMA is a research-based professional organization dedicated to advancing the concepts and practices of information resource management in modern organizations. The primary purpose of IRMA is to promo...

28/08/2021

Learn how data literacy is changing the world and giving you a better understanding of life's biggest problems in this "Important and Comprehensive" Guide to Statistical Thinking (New York). The bi...

28/08/2021

X
# Submit new EBook