1. Home
  2. Data Science
  3. NumPy
  4. Which of the following functions is used to find the…

Added 24 Feb 2024

Which of the following functions is used to find the unique elements of an array?

  1. unique()
  2. distinct()
  3. np.unique() Correct answer
  4. np.distinct()

Correct answer

C. np.unique()

14 views

MCQSEXAM

Explanation

np.unique() returns the sorted unique elements of an array. With return_counts=True it also reports how many times each value occurs.

There is no distinct() in NumPy — that name comes from SQL.

Practise more Data Science MCQs with answers and explanations on MCQsExam.com.

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