1. Home
  2. Data Science
  3. NumPy
  4. What does the np.where() function do in NumPy?

Added 25 Feb 2024

What does the np.where() function do in NumPy?

  1. Reshapes an array
  2. Computes the inverse of a matrix
  3. Returns the indices of elements that satisfy a condition Correct answer
  4. Computes the dot product of two arrays

Correct answer

C. Returns the indices of elements that satisfy a condition

15 views

MCQSEXAM

Explanation

The np.where() function returns the indices of elements that satisfy a given condition. It is a versatile tool for extracting specific elements or performing conditional operations on arrays.

Doubts & discussion

Not sure why the answer is C? 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