Python Practice › NumPy Programs › Program 58

Index of the maximum

EasyNumPy Programs · 58 of 100

Write a NumPy program to find the index of the maximum value.

Advertisement
Input
[76, 36, 56, 90]
Output
3

Approach

  1. argmax.

Solution

Python
import numpy as npprint(np.argmax([76, 36, 56, 90]))
Output
3
Advertisement

Learn the concept

New to this topic? Read the lesson, then come back.

More numpy programs

← All 100 NumPy Programs