{"id":8650,"date":"2021-06-12T10:55:54","date_gmt":"2021-06-12T05:25:54","guid":{"rendered":"https:\/\/python-programs.com\/?p=8650"},"modified":"2021-11-22T18:53:29","modified_gmt":"2021-11-22T13:23:29","slug":"find-max-value-its-index-in-numpy-array-numpy-amax","status":"publish","type":"post","link":"https:\/\/python-programs.com\/find-max-value-its-index-in-numpy-array-numpy-amax\/","title":{"rendered":"Find max value & its index in Numpy Array | numpy.amax()"},"content":{"rendered":"

Finding max value and it’s index in Numpy Array<\/h2>\n

In this article we will discuss about how we can find max value and the index of that max value in Numpy array using numpy.amx()<\/code>.<\/p>\n

numpy.amax( ) :<\/h3>\n
Syntax-numpy.amax(arr, axis=None, out=None, keepdims=<no value>, initial=<no value>)<\/pre>\n

Parameters :<\/strong><\/p>\n

    \n
  1. arr:<\/strong> Numpy array<\/li>\n
  2. axis: <\/strong>This is an optional parameter unless provided flattens the array.<\/li>\n<\/ol>\n

    (Default: Returns the array of max values)<\/p>\n

      \n
    1. Axis = 0: Returns array containing max values of each columns<\/li>\n
    2. Axis = 1: Returns array containing max values of each rows<\/li>\n<\/ol>\n

      Let’s see one by one how to find it in 1D and 2D Numpy array.<\/p>\n