1. Home
  2. Data Science
  3. NumPy
  4. Which function is used to find the indices of the maximum…

Added 25 Feb 2024

Which function is used to find the indices of the maximum and minimum elements of an array in NumPy?

  1. np.argmax() and np.argmin() Correct answer
  2. np.max() and np.min()
  3. np.argsort() and np.argpartition()
  4. np.where() and np.nonzero()

Correct answer

A. np.argmax() and np.argmin()

20 views

MCQSEXAM

Explanation

The np.argmax() and np.argmin() functions return the indices of the maximum and minimum elements of an array, respectively. They are useful for locating the positions of extreme values within arrays.

Reference

https://www.w3schools.com/python/numpy/default.asp

Doubts & discussion

Not sure why the answer is A? Ask here and get an explanation.

Ask a doubt about this MCQ

Shown after review. No links please.

More NumPy MCQs

Practise all NumPy MCQs

Similar MCQs