1. Home
  2. Data Science
  3. NumPy
  4. Which function is used to find the unique elements of an…

Added 25 Feb 2024

Which function is used to find the unique elements of an array in NumPy?

  1. np.unique() Correct answer
  2. np.sort()
  3. np.argmax()
  4. np.median()

Correct answer

A. np.unique()

18 views

MCQSEXAM

Explanation

The np.unique() function returns the unique elements of an array, sorted in ascending order. It is useful for identifying unique values in datasets and performing operations based on unique elements.

Reference

https://www.w3schools.com/python/numpy/numpy_random.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